Skip to content

Commit

Permalink
exit: Stop poorly open coding do_task_dead in make_task_dead
Browse files Browse the repository at this point in the history
When the kernel detects it is oops or otherwise force killing a task
while it exits the code poorly attempts to permanently stop the task
from scheduling.

I say poorly because it is possible for a task in TASK_UINTERRUPTIBLE
to be woken up.

As it makes no sense for the task to continue call do_task_dead
instead which actually does the work and permanently removes the task
from the scheduler.  Guaranteeing the task will never be woken
up again.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Dec 13, 2021
1 parent 05ea042 commit 7f80a2f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,7 @@ 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);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule();
do_task_dead();
}

do_exit(signr);
Expand Down

0 comments on commit 7f80a2f

Please sign in to comment.