Patchwork [82/93] wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date Feb. 5, 2013, 10:07 p.m.
Message ID <1360102042-10732-83-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/218441/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - Feb. 5, 2013, 10:07 p.m.
3.5.7.5 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oleg Nesterov <oleg@redhat.com>

commit 9067ac85d533651b98c2ff903182a20cbb361fcb upstream.

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>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 kernel/sched/core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9f81a3a..3231df8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1686,7 +1686,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);