]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ptrace exit fix
authorDaniel Jacobowitz <dan@debian.org>
Sat, 31 Aug 2002 02:52:25 +0000 (19:52 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Sat, 31 Aug 2002 02:52:25 +0000 (19:52 -0700)
Gotta ptrace_unlink before calling release_task, and instead of fiddling
with the real_parent directly.

kernel/exit.c

index 6526b6b9484912d469c979ebfe8e095b8e5c37ed..9a30bc907dc57358e2be95d20cbc2a1bd43e3ecf 100644 (file)
@@ -712,15 +712,19 @@ repeat:
                                if (retval)
                                        goto end_wait4; 
                                retval = p->pid;
-                               if (p->real_parent != p->parent || p->ptrace) {
+                               if (p->real_parent != p->parent) {
                                        write_lock_irq(&tasklist_lock);
-                                       remove_parent(p);
-                                       p->parent = p->real_parent;
-                                       add_parent(p, p->parent);
+                                       ptrace_unlink(p);
                                        do_notify_parent(p, SIGCHLD);
                                        write_unlock_irq(&tasklist_lock);
-                               } else
+                               } else {
+                                       if (p->ptrace) {
+                                               write_lock_irq(&tasklist_lock);
+                                               ptrace_unlink(p);
+                                               write_unlock_irq(&tasklist_lock);
+                                       }
                                        release_task(p);
+                               }
                                goto end_wait4;
                        default:
                                continue;