Commit 912616f1 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

exit: Guarantee make_task_dead leaks the tsk when calling do_task_exit

Change the task state to EXIT_DEAD and take an extra rcu_refernce
to guarantee the task will not be reaped and that it will not be
freed.

Link: https://lkml.kernel.org/r/YdUzjrLAlRiNLQp2@zeniv-ca.linux.org.uk


Pointed-out-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Fixes: 7f80a2fd ("exit: Stop poorly open coding do_task_dead in make_task_dead")
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 85be9ae7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -885,6 +885,8 @@ void __noreturn make_task_dead(int signr)
	if (unlikely(tsk->flags & PF_EXITING)) {
		pr_alert("Fixing recursive fault but reboot is needed!\n");
		futex_exit_recursive(tsk);
		tsk->exit_state = EXIT_DEAD;
		refcount_inc(&tsk->rcu_users);
		do_task_dead();
	}