public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] ptrace_untrace: fix the SIGNAL_STOP_STOPPED check
@ 2009-02-08 18:47 Oleg Nesterov
  2009-02-09  1:50 ` Roland McGrath
  0 siblings, 1 reply; 4+ 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

This bug is ancient too. ptrace_untrace() must not resume the task
if the group stop in progress, we should set TASK_STOPPED instead.

Unfortunately, we still have problems here:

	- if the process/thread was traced, SIGNAL_STOP_STOPPED
	  does not necessary means this thread group is stopped.

	- ptrace breaks the bookkeeping of ->group_stop_count.

(the comment above ptrace_untrace() doesn't look exactly right too).

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

--- 6.29-rc3/kernel/ptrace.c~3_FIX_STOPPED	2009-02-08 06:22:26.000000000 +0100
+++ 6.29-rc3/kernel/ptrace.c	2009-02-08 08:52:14.000000000 +0100
@@ -60,7 +60,8 @@ 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 ||
+		    child->signal->group_stop_count)
 			__set_task_state(child, TASK_STOPPED);
 		else
 			wake_up_process(child);


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

end of thread, other threads:[~2009-02-09  3:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-08 18:47 [PATCH 3/3] ptrace_untrace: fix the SIGNAL_STOP_STOPPED check Oleg Nesterov
2009-02-09  1:50 ` Roland McGrath
2009-02-09  3:09   ` Oleg Nesterov
2009-02-09  3:59     ` Roland McGrath

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