]> Git Repo - linux.git/commitdiff
reparent_thread: fix the "is it traced" check
authorOleg Nesterov <[email protected]>
Thu, 2 Apr 2009 23:58:16 +0000 (16:58 -0700)
committerLinus Torvalds <[email protected]>
Fri, 3 Apr 2009 02:04:59 +0000 (19:04 -0700)
reparent_thread() uses ptrace_reparented() to check whether this thread is
ptraced, in that case we should not notify the new parent.

But ptrace_reparented() is not exactly correct when the reparented thread
is traced by /sbin/init, because forget_original_parent() has already
changed ->real_parent.

Currently, the only problem is the false notification.  But with the next
patch the kernel crash in this (yes, pathological) case.

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Roland McGrath <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/exit.c

index 405e6877168b53db3995466c9445a9231860e367..5be0a406faeb63672c50bb9e547798de4aa56587 100644 (file)
@@ -832,7 +832,7 @@ static void reparent_thread(struct task_struct *p, struct task_struct *father)
        /* If we'd notified the old parent about this child's death,
         * also notify the new parent.
         */
-       if (!ptrace_reparented(p) &&
+       if (!p->ptrace &&
            p->exit_state == EXIT_ZOMBIE && thread_group_empty(p))
                do_notify_parent(p, p->exit_signal);
 
This page took 0.062616 seconds and 4 git commands to generate.