aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/fork.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 51ad0b0b7266..b51fd2ccb2f1 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -979,6 +979,16 @@ static struct task_struct *copy_process(unsigned long clone_flags,
979 if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM)) 979 if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
980 return ERR_PTR(-EINVAL); 980 return ERR_PTR(-EINVAL);
981 981
982 /*
983 * Siblings of global init remain as zombies on exit since they are
984 * not reaped by their parent (swapper). To solve this and to avoid
985 * multi-rooted process trees, prevent global and container-inits
986 * from creating siblings.
987 */
988 if ((clone_flags & CLONE_PARENT) &&
989 current->signal->flags & SIGNAL_UNKILLABLE)
990 return ERR_PTR(-EINVAL);
991
982 retval = security_task_create(clone_flags); 992 retval = security_task_create(clone_flags);
983 if (retval) 993 if (retval)
984 goto fork_out; 994 goto fork_out;