From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932076Ab3AUTtJ (ORCPT ); Mon, 21 Jan 2013 14:49:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10904 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488Ab3AUTtG (ORCPT ); Mon, 21 Jan 2013 14:49:06 -0500 Date: Mon, 21 Jan 2013 20:48:17 +0100 From: Oleg Nesterov To: Linus Torvalds Cc: Dan Carpenter , Kernel Security , Michael Davidson , Suleiman Souhlal , Julien Tinnes , Aaron Durbin , Andrew Morton , Linux Kernel Mailing List , Tejun Heo , Roland McGrath , Tony Luck , Fenghua Yu , Greg Kroah-Hartman Subject: [PATCH v3 3/3] wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task Message-ID: <20130121194817.GD18775@redhat.com> References: <20130118175224.GA520@redhat.com> <20130118185559.GA3773@redhat.com> <20130120192448.GA6771@redhat.com> <20130120192527.GC6771@redhat.com> <20130121172151.GA4691@redhat.com> <20130121194723.GA18775@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130121194723.GA18775@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/sched/core.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 257002c..26058d0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1523,7 +1523,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); -- 1.5.5.1