aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 66635c80a813..bf46287c91a4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1177,7 +1177,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1177 * don't allow the creation of threads. 1177 * don't allow the creation of threads.
1178 */ 1178 */
1179 if ((clone_flags & (CLONE_VM|CLONE_NEWPID)) && 1179 if ((clone_flags & (CLONE_VM|CLONE_NEWPID)) &&
1180 (task_active_pid_ns(current) != current->nsproxy->pid_ns)) 1180 (task_active_pid_ns(current) !=
1181 current->nsproxy->pid_ns_for_children))
1181 return ERR_PTR(-EINVAL); 1182 return ERR_PTR(-EINVAL);
1182 1183
1183 retval = security_task_create(clone_flags); 1184 retval = security_task_create(clone_flags);
@@ -1351,7 +1352,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1351 1352
1352 if (pid != &init_struct_pid) { 1353 if (pid != &init_struct_pid) {
1353 retval = -ENOMEM; 1354 retval = -ENOMEM;
1354 pid = alloc_pid(p->nsproxy->pid_ns); 1355 pid = alloc_pid(p->nsproxy->pid_ns_for_children);
1355 if (!pid) 1356 if (!pid)
1356 goto bad_fork_cleanup_io; 1357 goto bad_fork_cleanup_io;
1357 } 1358 }
@@ -1546,7 +1547,7 @@ static inline void init_idle_pids(struct pid_link *links)
1546 } 1547 }
1547} 1548}
1548 1549
1549struct task_struct * __cpuinit fork_idle(int cpu) 1550struct task_struct *fork_idle(int cpu)
1550{ 1551{
1551 struct task_struct *task; 1552 struct task_struct *task;
1552 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0); 1553 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0);
@@ -1679,6 +1680,12 @@ SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
1679 int __user *, parent_tidptr, 1680 int __user *, parent_tidptr,
1680 int __user *, child_tidptr, 1681 int __user *, child_tidptr,
1681 int, tls_val) 1682 int, tls_val)
1683#elif defined(CONFIG_CLONE_BACKWARDS3)
1684SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp,
1685 int, stack_size,
1686 int __user *, parent_tidptr,
1687 int __user *, child_tidptr,
1688 int, tls_val)
1682#else 1689#else
1683SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, 1690SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
1684 int __user *, parent_tidptr, 1691 int __user *, parent_tidptr,