Commit 8a1296ae authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

exit: reparent: fix the dead-parent PR_SET_CHILD_SUBREAPER reparenting

The ->has_child_subreaper code in find_new_reaper() finds alive "thread"
but returns another "reaper" thread which can be dead.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Cc: Aaron Tomlin <atomlin@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Lennart Poettering <lennart@poettering.net>
Cc: Sterling Alexander <stalexan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c35a7f18
...@@ -512,7 +512,7 @@ static struct task_struct *find_new_reaper(struct task_struct *father) ...@@ -512,7 +512,7 @@ static struct task_struct *find_new_reaper(struct task_struct *father)
thread = reaper; thread = reaper;
do { do {
if (!(thread->flags & PF_EXITING)) if (!(thread->flags & PF_EXITING))
return reaper; return thread;
} while_each_thread(reaper, thread); } while_each_thread(reaper, thread);
} }
} }
......
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