diff options
| author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-05-02 17:37:49 +0200 | 
|---|---|---|
| committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-05-02 17:54:19 +0200 | 
| commit | c032862fba51a3ca504752d3a25186b324c5ce83 (patch) | |
| tree | 955dc2ba4ab3df76ecc2bb780ee84aca04967e8d /ipc/mqueue.c | |
| parent | fda76e074c7737fc57855dd17c762e50ed526052 (diff) | |
| parent | 8700c95adb033843fc163d112b9d21d4fda78018 (diff) | |
| download | olio-linux-3.10-c032862fba51a3ca504752d3a25186b324c5ce83.tar.xz olio-linux-3.10-c032862fba51a3ca504752d3a25186b324c5ce83.zip  | |
Merge commit '8700c95adb03' into timers/nohz
The full dynticks tree needs the latest RCU and sched
upstream updates in order to fix some dependencies.
Merge a common upstream merge point that has these
updates.
Conflicts:
	include/linux/perf_event.h
	kernel/rcutree.h
	kernel/rcutree_plugin.h
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'ipc/mqueue.c')
| -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 e5c4f609f22..e4e47f64744 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;  |