aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index e82a14577a98..660c2b8765bc 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -825,6 +825,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
825 atomic_set(&sig->live, 1); 825 atomic_set(&sig->live, 1);
826 init_waitqueue_head(&sig->wait_chldexit); 826 init_waitqueue_head(&sig->wait_chldexit);
827 sig->flags = 0; 827 sig->flags = 0;
828 if (clone_flags & CLONE_NEWPID)
829 sig->flags |= SIGNAL_UNKILLABLE;
828 sig->group_exit_code = 0; 830 sig->group_exit_code = 0;
829 sig->group_exit_task = NULL; 831 sig->group_exit_task = NULL;
830 sig->group_stop_count = 0; 832 sig->group_stop_count = 0;
@@ -1109,7 +1111,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1109 goto bad_fork_cleanup_mm; 1111 goto bad_fork_cleanup_mm;
1110 if ((retval = copy_io(clone_flags, p))) 1112 if ((retval = copy_io(clone_flags, p)))
1111 goto bad_fork_cleanup_namespaces; 1113 goto bad_fork_cleanup_namespaces;
1112 retval = copy_thread(0, clone_flags, stack_start, stack_size, p, regs); 1114 retval = copy_thread(clone_flags, stack_start, stack_size, p, regs);
1113 if (retval) 1115 if (retval)
1114 goto bad_fork_cleanup_io; 1116 goto bad_fork_cleanup_io;
1115 1117
@@ -1247,8 +1249,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1247 p->signal->leader_pid = pid; 1249 p->signal->leader_pid = pid;
1248 tty_kref_put(p->signal->tty); 1250 tty_kref_put(p->signal->tty);
1249 p->signal->tty = tty_kref_get(current->signal->tty); 1251 p->signal->tty = tty_kref_get(current->signal->tty);
1250 set_task_pgrp(p, task_pgrp_nr(current));
1251 set_task_session(p, task_session_nr(current));
1252 attach_pid(p, PIDTYPE_PGID, task_pgrp(current)); 1252 attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
1253 attach_pid(p, PIDTYPE_SID, task_session(current)); 1253 attach_pid(p, PIDTYPE_SID, task_session(current));
1254 list_add_tail_rcu(&p->tasks, &init_task.tasks); 1254 list_add_tail_rcu(&p->tasks, &init_task.tasks);
@@ -1472,6 +1472,7 @@ void __init proc_caches_init(void)
1472 mm_cachep = kmem_cache_create("mm_struct", 1472 mm_cachep = kmem_cache_create("mm_struct",
1473 sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN, 1473 sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN,
1474 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); 1474 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
1475 vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC);
1475 mmap_init(); 1476 mmap_init();
1476} 1477}
1477 1478