diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-04-02 16:58:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 19:04:59 -0700 |
commit | 4576145c1ecdaaea9ef8976a48335206aa1ebf91 (patch) | |
tree | b20b51848380b708f4158852b1bb4afa29ffc5f0 /include/linux/ptrace.h | |
parent | b1b4c6799fb59e710454bfe0ab477cb8523a8667 (diff) | |
download | linux-4576145c1ecdaaea9ef8976a48335206aa1ebf91.tar.gz linux-4576145c1ecdaaea9ef8976a48335206aa1ebf91.tar.bz2 linux-4576145c1ecdaaea9ef8976a48335206aa1ebf91.zip |
ptrace: fix possible zombie leak on PTRACE_DETACH
When ptrace_detach() takes tasklist, the tracee can be SIGKILL'ed. If it
has already passed exit_notify() we can leak a zombie, because a) ptracing
disables the auto-reaping logic, and b) ->real_parent was not notified
about the child's death.
ptrace_detach() should follow the ptrace_exit's logic, change the code
accordingly.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Tested-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/ptrace.h')
-rw-r--r-- | include/linux/ptrace.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 98b93ca4db06..1a2b0cb55535 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -94,6 +94,7 @@ extern void ptrace_notify(int exit_code); extern void __ptrace_link(struct task_struct *child, struct task_struct *new_parent); extern void __ptrace_unlink(struct task_struct *child); +extern int __ptrace_detach(struct task_struct *tracer, struct task_struct *p); extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags); #define PTRACE_MODE_READ 1 #define PTRACE_MODE_ATTACH 2 |