aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/fork.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index c9eaf2013002..3561391ca450 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1173,10 +1173,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1173 return ERR_PTR(-EINVAL); 1173 return ERR_PTR(-EINVAL);
1174 1174
1175 /* 1175 /*
1176 * If the new process will be in a different pid namespace 1176 * If the new process will be in a different pid namespace don't
1177 * don't allow the creation of threads. 1177 * allow it to share a thread group or signal handlers with the
1178 * forking task.
1178 */ 1179 */
1179 if ((clone_flags & (CLONE_VM|CLONE_NEWPID)) && 1180 if ((clone_flags & (CLONE_SIGHAND | CLONE_NEWPID)) &&
1180 (task_active_pid_ns(current) != 1181 (task_active_pid_ns(current) !=
1181 current->nsproxy->pid_ns_for_children)) 1182 current->nsproxy->pid_ns_for_children))
1182 return ERR_PTR(-EINVAL); 1183 return ERR_PTR(-EINVAL);