public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ptrace_stop: remove the wrong ->group_stop_count bookkeeping
@ 2007-12-08 18:38 Oleg Nesterov
  2007-12-09  0:31 ` Eric W. Biederman
  0 siblings, 1 reply; 6+ messages in thread
From: Oleg Nesterov @ 2007-12-08 18:38 UTC (permalink / raw)
  To: Andrew Morton, Davide Libenzi, Eric W. Biederman, Ingo Molnar,
	Linus Torvalds, Roland McGrath
  Cc: linux-kernel

ptrace_stop() decrements ->group_stop_count to "participate" in group stop.
This looks very wrong to me, the task can in fact decrement this counter twice.
If the tracee returns to the user-space before other threads complete the group
stop, it will notice TIF_SIGPENDING and do it again.

Another problem is that we don't set SIGNAL_STOP_STOPPED if the counter becomes
zero.

I must admit, I don't undestand the reason why this code was added, it is very
old.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- PT/kernel/signal.c~5_ptrace_stop	2007-12-08 16:46:37.000000000 +0300
+++ PT/kernel/signal.c	2007-12-08 16:47:53.000000000 +0300
@@ -1579,13 +1579,6 @@ static inline int may_ptrace_stop(void)
  */
 static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
 {
-	/*
-	 * If there is a group stop in progress,
-	 * we must participate in the bookkeeping.
-	 */
-	if (current->signal->group_stop_count > 0)
-		--current->signal->group_stop_count;
-
 	current->last_siginfo = info;
 	current->exit_code = exit_code;
 


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

end of thread, other threads:[~2008-01-11  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-08 18:38 [PATCH 2/3] ptrace_stop: remove the wrong ->group_stop_count bookkeeping Oleg Nesterov
2007-12-09  0:31 ` Eric W. Biederman
2007-12-09 14:05   ` Oleg Nesterov
2008-01-10 10:41     ` Petr Tesarik
2008-01-10 21:39       ` Oleg Nesterov
2008-01-11  8:50         ` Petr Tesarik

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