diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-10-13 13:51:37 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-10-13 13:51:37 +1100 |
commit | e9aac7c34669d978c806f8f0ef9ce09098f657cf (patch) | |
tree | f4dc227a1a7dcb0f8252c1e3f38b0e5b19784339 /fs | |
parent | f815dcd54acfdce6d8ce53176b88c6d840031c6c (diff) | |
parent | a1998908ba46526ac5cbbb9aae610cb234bd9f33 (diff) |
Merge remote-tracking branch 'userns/for-next'
Conflicts:
fs/nfs/client.c
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namespace.c | 9 |
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 |