]> git.baikalelectronics.ru Git - kernel.git/commit
ptrace: fix possible zombie leak on PTRACE_DETACH
authorOleg Nesterov <oleg@redhat.com>
Thu, 2 Apr 2009 23:58:14 +0000 (16:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Apr 2009 02:04:59 +0000 (19:04 -0700)
commitaf3b52f1f170e155a6ecf1ac738c85f18c1641d3
treeb20b51848380b708f4158852b1bb4afa29ffc5f0
parentf88bca8aef0e5fe3d68ed52528df359fa1711ab4
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>
include/linux/ptrace.h
kernel/ptrace.c