aboutsummaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-08 11:29:45 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-08 11:29:45 +0000
commit07afa01813d547570a762034f0dce7fd8baa8b3d (patch)
tree5b0a34f64e0f0e824ea153adeb6c98b98dd852ac /kernel/fork.c
parent01a61f490cab732542753db69e17e5db657d185a (diff)
parent3b4bc7bccc7857274705b05cf81a0c72cfd0b0dd (diff)
Merge remote-tracking branch 'asoc/fix/pxa' into asoc-pxa
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index a31b823b3c2..65ca6d27f24 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1166,6 +1166,14 @@ static struct task_struct *copy_process(unsigned long clone_flags,
current->signal->flags & SIGNAL_UNKILLABLE)
return ERR_PTR(-EINVAL);
+ /*
+ * If the new process will be in a different pid namespace
+ * don't allow the creation of threads.
+ */
+ if ((clone_flags & (CLONE_VM|CLONE_NEWPID)) &&
+ (task_active_pid_ns(current) != current->nsproxy->pid_ns))
+ return ERR_PTR(-EINVAL);
+
retval = security_task_create(clone_flags);
if (retval)
goto fork_out;