]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHERRY-PICK: UPSTREAM: wake_up_process() should be never used to wakeup a TASK_STOPPE...
authorOleg Nesterov <oleg@redhat.com>
Mon, 21 Jan 2013 19:48:17 +0000 (20:48 +0100)
committerKees Cook <keescook@chromium.org>
Thu, 21 Feb 2013 00:24:42 +0000 (16:24 -0800)
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>
BUG=chromium-os:38610
TEST=link build

(cherry picked from upstream commit 9067ac85d533651b98c2ff903182a20cbb361fcb)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43145
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Change-Id: I5cadeba230dc6d27403bfc6c3522075c4385295b
(cherry picked from ToT commit 28d8d1bb8bed3679240993c0e30040ec0b3e3db2)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43664
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
kernel/sched/core.c

index 37d4146d34691a31b6fa1a37a8bdef975667d68d..366ed9865644e321892ad3eccfac5f2a5e5579b4 100644 (file)
@@ -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);