diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-03 18:22:44 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-03 18:22:51 +0100 |
commit | 89cab4624a8c0ed81a1b74b6f8c884641cac5b9d (patch) | |
tree | 3a2f1ae599ee4bae60ccf11cc154d73c210c6388 /ipc | |
parent | 2e1cc199fc8666ac5fda200e8a99f1e4dea07175 (diff) | |
parent | c6f9b1eb0e5df468891eff17f981b76c86f95f3a (diff) | |
download | linux-89cab4624a8c0ed81a1b74b6f8c884641cac5b9d.tar.bz2 |
ASoC: core: Merge Samsung fixes to avoid trivial context conflict
Merge branch 'fix/samsung' of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into
asoc-component to resolve trivial conflict
Conflicts:
sound/soc/samsung/i2s.c
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index e5c4f609f22c..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, 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); } @@ -840,7 +848,8 @@ out_putfd: fd = error; } mutex_unlock(&root->d_inode->i_mutex); - mnt_drop_write(mnt); + if (!ro) + mnt_drop_write(mnt); out_putname: putname(name); return fd; |