summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2014-10-13 13:51:37 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2014-10-13 13:51:37 +1100
commite9aac7c34669d978c806f8f0ef9ce09098f657cf (patch)
treef4dc227a1a7dcb0f8252c1e3f38b0e5b19784339 /fs
parentf815dcd54acfdce6d8ce53176b88c6d840031c6c (diff)
parenta1998908ba46526ac5cbbb9aae610cb234bd9f33 (diff)
Merge remote-tracking branch 'userns/for-next'
Conflicts: fs/nfs/client.c
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 348562f14e93..e6eb70d7416c 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2057,6 +2057,15 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
if (path->dentry != path->mnt->mnt_root)
return -EINVAL;
+ /* Only in special cases allow devices from mounts created
+ * outside the initial user namespace.
+ */
+ if ((mnt->mnt_ns->user_ns != &init_user_ns) &&
+ !(sb->s_type->fs_flags & FS_USERNS_DEV_MOUNT)) {
+ flags |= MS_NODEV;
+ mnt_flags |= MNT_NODEV;
+ }
+
/* Don't allow changing of locked mnt flags.
*
* No locks need to be held here while testing the various