diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-04-02 19:58:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:04:59 -0400 |
commit | b1442b055c154699a6a2c436f3352f71b6beede3 (patch) | |
tree | dda315fddb15936bc74eb9c74bec29b64e65b71c /kernel/exit.c | |
parent | 0a967a044a777e8b9c739120927114ddc0094298 (diff) |
reparent_thread: fix the "is it traced" check
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 <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 405e6877168b..5be0a406faeb 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -832,7 +832,7 @@ static void reparent_thread(struct task_struct *p, struct task_struct *father) | |||
832 | /* If we'd notified the old parent about this child's death, | 832 | /* If we'd notified the old parent about this child's death, |
833 | * also notify the new parent. | 833 | * also notify the new parent. |
834 | */ | 834 | */ |
835 | if (!ptrace_reparented(p) && | 835 | if (!p->ptrace && |
836 | p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) | 836 | p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) |
837 | do_notify_parent(p, p->exit_signal); | 837 | do_notify_parent(p, p->exit_signal); |
838 | 838 | ||