public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ptrace_untrace: use wake_up_process() instead of bogus signal_wake_up()
@ 2009-02-08 18:47 Oleg Nesterov
  2009-02-09  1:38 ` Roland McGrath
  0 siblings, 1 reply; 5+ messages in thread
From: Oleg Nesterov @ 2009-02-08 18:47 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jerome Marchand, Roland McGrath, Denys Vlasenko, linux-kernel

Both ptrace_stop() and do_signal_stop() pathes always take ->siglock and
do recalc_sigpending() after wakeup.

This means that if the tracer sees task_is_traced(child) == T (perhaps it
it was actually TASK_STOPPED before ptrace_check_attach) under ->siglock,
it can use the plain wake_up_process() instead of signal_wake_up().

(and note that ptrace_resume() does wake_up_process() too).

We also have sys_clone(CLONE_STOPPED), but a) it must set TIF_SIGPENDING
by hand anyway, and b) it is deprecated.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- 6.29-rc3/kernel/ptrace.c~2_KILL_SIGWAKE	2009-02-08 05:11:52.000000000 +0100
+++ 6.29-rc3/kernel/ptrace.c	2009-02-08 06:22:26.000000000 +0100
@@ -60,11 +60,10 @@ static void ptrace_untrace(struct task_s
 {
 	spin_lock(&child->sighand->siglock);
 	if (task_is_traced(child)) {
-		if (child->signal->flags & SIGNAL_STOP_STOPPED) {
+		if (child->signal->flags & SIGNAL_STOP_STOPPED)
 			__set_task_state(child, TASK_STOPPED);
-		} else {
-			signal_wake_up(child, 1);
-		}
+		else
+			wake_up_process(child);
 	}
 	spin_unlock(&child->sighand->siglock);
 }


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-10 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-08 18:47 [PATCH 2/3] ptrace_untrace: use wake_up_process() instead of bogus signal_wake_up() Oleg Nesterov
2009-02-09  1:38 ` Roland McGrath
2009-02-09  2:42   ` Oleg Nesterov
2009-02-09  3:42     ` Roland McGrath
2009-02-10 21:35       ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox