[Devel] [PATCH] fs: don't add MNT_NODEV for ve mounts
Andrew Vagin
avagin at openvz.org
Wed Oct 7 00:59:38 PDT 2015
Reported-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
fs/namespace.c | 8 +++++++-
scripts/basic/fixdep | Bin 13875 -> 14262 bytes
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 77a1ede..1377488 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2167,6 +2167,7 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
struct file_system_type *type;
struct user_namespace *user_ns = current->nsproxy->mnt_ns->user_ns;
struct vfsmount *mnt;
+ struct user_namespace *root_user_ns;
int err;
if (!fstype)
@@ -2176,7 +2177,12 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
if (!type)
return -ENODEV;
- if (user_ns != &init_user_ns) {
+ if (get_exec_env()->init_cred)
+ root_user_ns = get_exec_env()->init_cred->user_ns;
+ else
+ root_user_ns = &init_user_ns;
+
+ if (user_ns != root_user_ns) {
if (!(type->fs_flags & FS_USERNS_MOUNT)) {
put_filesystem(type);
return -EPERM;
More information about the Devel
mailing list