Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
		}
		}
	}
	}