Commit b558cb50 authored by Sukadev Bhattiprolu's avatar Sukadev Bhattiprolu Committed by James Toy

When global or container-init processes use CLONE_PARENT, they create a

multi-rooted process tree.  Besides siblings of global init remain as
zombies on exit since they are not reaped by their parent (swapper).  So
prevent global and container-inits from creating siblings.
Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@us.ibm.com>
Acked-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Cc: Oren Laadan <orenl@cs.columbia.edu>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f3725c8c
...@@ -983,6 +983,16 @@ static struct task_struct *copy_process(unsigned long clone_flags, ...@@ -983,6 +983,16 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM)) if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
/*
* Siblings of global init remain as zombies on exit since they are
* not reaped by their parent (swapper). To solve this and to avoid
* multi-rooted process trees, prevent global and container-inits
* from creating siblings.
*/
if ((clone_flags & CLONE_PARENT) &&
current->signal->flags & SIGNAL_UNKILLABLE)
return ERR_PTR(-EINVAL);
retval = security_task_create(clone_flags); retval = security_task_create(clone_flags);
if (retval) if (retval)
goto fork_out; goto fork_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment