diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-28 16:43:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-28 16:43:46 -0400 |
commit | 2c3de1c2d7d68c6ba4c1ecd82c68285f34d9609e (patch) | |
tree | 6a09ce761173a966718f9009514dcc90bd9947b7 /ipc/mqueue.c | |
parent | 9064171268d838b8f283fe111ef086b9479d059a (diff) | |
parent | 87a8ebd637dafc255070f503909a053cf0d98d3f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull userns fixes from Eric W Biederman:
"The bulk of the changes are fixing the worst consequences of the user
namespace design oversight in not considering what happens when one
namespace starts off as a clone of another namespace, as happens with
the mount namespace.
The rest of the changes are just plain bug fixes.
Many thanks to Andy Lutomirski for pointing out many of these issues."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
userns: Restrict when proc and sysfs can be mounted
ipc: Restrict mounting the mqueue filesystem
vfs: Carefully propogate mounts across user namespaces
vfs: Add a mount flag to lock read only bind mounts
userns: Don't allow creation if the user is chrooted
yama: Better permission check for ptraceme
pid: Handle the exit of a multi-threaded init.
scm: Require CAP_SYS_ADMIN over the current pidns to spoof pids.
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 3953fda2e8bd..e4e47f647446 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -330,8 +330,16 @@ static struct dentry *mqueue_mount(struct file_system_type *fs_type, | |||
330 | int flags, const char *dev_name, | 330 | int flags, const char *dev_name, |
331 | void *data) | 331 | void *data) |
332 | { | 332 | { |
333 | if (!(flags & MS_KERNMOUNT)) | 333 | if (!(flags & MS_KERNMOUNT)) { |
334 | data = current->nsproxy->ipc_ns; | 334 | struct ipc_namespace *ns = current->nsproxy->ipc_ns; |
335 | /* Don't allow mounting unless the caller has CAP_SYS_ADMIN | ||
336 | * over the ipc namespace. | ||
337 | */ | ||
338 | if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN)) | ||
339 | return ERR_PTR(-EPERM); | ||
340 | |||
341 | data = ns; | ||
342 | } | ||
335 | return mount_ns(fs_type, flags, data, mqueue_fill_super); | 343 | return mount_ns(fs_type, flags, data, mqueue_fill_super); |
336 | } | 344 | } |
337 | 345 | ||