From patchwork Mon Feb 4 21:46:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3.5.y.z, extended, stable] Patch "wake_up_process() should be never used to wakeup a" has been added to staging queue Date: Mon, 04 Feb 2013 11:46:33 -0000 From: Herton Ronaldo Krzesinski X-Patchwork-Id: 218085 Message-Id: <1360014393-3782-1-git-send-email-herton.krzesinski@canonical.com> To: Oleg Nesterov Cc: kernel-team@lists.ubuntu.com, Linus Torvalds This is a note to let you know that I have just added a patch titled wake_up_process() should be never used to wakeup a to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.5.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Herton ------ >From 6b2a5894ed6eaa524d3b60846dee7a7cb931c8b4 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 21 Jan 2013 20:48:17 +0100 Subject: [PATCH] wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task 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 Signed-off-by: Linus Torvalds Signed-off-by: Herton Ronaldo Krzesinski --- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.7.9.5 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);