[PATCH] fix non-leader exec under ptrace
authorRoland McGrath <roland@redhat.com>
Wed, 12 Apr 2006 23:30:20 +0000 (16:30 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 14 Apr 2006 15:59:13 +0000 (08:59 -0700)
This reverts most of commit 30e0fca6c1d7d26f3f2daa4dd2b12c51dadc778a.
It broke the case of non-leader MT exec when ptraced.
I think the bug it was intended to fix was already addressed by commit
788e05a67c343fa22f2ae1d3ca264e7f15c25eaf.

Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/ptrace.c
kernel/signal.c

index 0eeb7e66722c899fa2f53ee7b451d981aa91f6a3..4e0f0ec003f751a0aa91e2d8388365f042f072d9 100644 (file)
@@ -56,10 +56,6 @@ void ptrace_untrace(task_t *child)
                        signal_wake_up(child, 1);
                }
        }
-       if (child->signal->flags & SIGNAL_GROUP_EXIT) {
-               sigaddset(&child->pending.signal, SIGKILL);
-               signal_wake_up(child, 1);
-       }
        spin_unlock(&child->sighand->siglock);
 }
 
@@ -81,7 +77,8 @@ void __ptrace_unlink(task_t *child)
                add_parent(child);
        }
 
-       ptrace_untrace(child);
+       if (child->state == TASK_TRACED)
+               ptrace_untrace(child);
 }
 
 /*
index b14f895027c3491cbb0283b2dd7a9d055d35b570..e5f8aea78ffebd71a1322ca8279321aac3b077e6 100644 (file)
@@ -1754,9 +1754,9 @@ relock:
                        /* Let the debugger run.  */
                        ptrace_stop(signr, signr, info);
 
-                       /* We're back.  Did the debugger cancel the sig or group_exit? */
+                       /* We're back.  Did the debugger cancel the sig */
                        signr = current->exit_code;
-                       if (signr == 0 || current->signal->flags & SIGNAL_GROUP_EXIT)
+                       if (signr == 0)
                                continue;
 
                        current->exit_code = 0;