Skip to content

Commit 9067ac8

Browse files
oleg-nesterovtorvalds
authored andcommitted
wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task
wake_up_process() should never wakeup a TASK_STOPPED/TRACED task. Change it to use TASK_NORMAL and add the WARN_ON(). TASK_ALL has no other users, probably can be killed. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9899d11 commit 9067ac8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,8 @@ static void try_to_wake_up_local(struct task_struct *p)
15231523
*/
15241524
int wake_up_process(struct task_struct *p)
15251525
{
1526-
return try_to_wake_up(p, TASK_ALL, 0);
1526+
WARN_ON(task_is_stopped_or_traced(p));
1527+
return try_to_wake_up(p, TASK_NORMAL, 0);
15271528
}
15281529
EXPORT_SYMBOL(wake_up_process);
15291530

0 commit comments

Comments
 (0)