From ac863b39e8c496057850a024d760ad9c0cf43821 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 21 Jan 2013 20:48:17 +0100 Subject: [PATCH] CHERRY-PICK: UPSTREAM: 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 Signed-off-by: Linus Torvalds BUG=chromium-os:38610 TEST=link build (cherry picked from upstream commit 9067ac85d533651b98c2ff903182a20cbb361fcb) Signed-off-by: Kees Cook Reviewed-on: https://gerrit.chromium.org/gerrit/43145 Reviewed-by: Olof Johansson Reviewed-by: Mandeep Singh Baines Change-Id: I5cadeba230dc6d27403bfc6c3522075c4385295b (cherry picked from ToT commit 28d8d1bb8bed3679240993c0e30040ec0b3e3db2) Signed-off-by: Kees Cook Reviewed-on: https://gerrit.chromium.org/gerrit/43664 Reviewed-by: Mandeep Singh Baines --- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 37d4146d34691..366ed9865644e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1688,7 +1688,8 @@ out: */ int wake_up_process(struct task_struct *p) { - return try_to_wake_up(p, TASK_ALL, 0); + WARN_ON(task_is_stopped_or_traced(p)); + return try_to_wake_up(p, TASK_NORMAL, 0); } EXPORT_SYMBOL(wake_up_process); -- 2.39.5