Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361883
b: refs/heads/master
c: a636b70
h: refs/heads/master
i:
  361881: 8a50d3a
  361879: 346a167
v: v3
  • Loading branch information
Eric W. Biederman committed Mar 27, 2013
1 parent 4b7708b commit 64416fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9
refs/heads/master: a636b702ed1805e988ad3d8ff8b52c060f8b341c
12 changes: 10 additions & 2 deletions trunk/ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,16 @@ static struct dentry *mqueue_mount(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
{
if (!(flags & MS_KERNMOUNT))
data = current->nsproxy->ipc_ns;
if (!(flags & MS_KERNMOUNT)) {
struct ipc_namespace *ns = current->nsproxy->ipc_ns;
/* Don't allow mounting unless the caller has CAP_SYS_ADMIN
* over the ipc namespace.
*/
if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN))
return ERR_PTR(-EPERM);

data = ns;
}
return mount_ns(fs_type, flags, data, mqueue_fill_super);
}

Expand Down

0 comments on commit 64416fc

Please sign in to comment.