Only reparent a traced process to its old parent if the tracing process is
authorjhb <jhb@FreeBSD.org>
Fri, 22 May 2015 11:04:54 +0000 (11:04 +0000)
committerjhb <jhb@FreeBSD.org>
Fri, 22 May 2015 11:04:54 +0000 (11:04 +0000)
commit5ad66fe3b2ec48024e4b2a87477228443a9e414b
tree47cdcadd912a4579dcb60a05036d804bdc6d6e9f
parent9b4a921aab689f5712cf07c64a9f69f176ff2337
Only reparent a traced process to its old parent if the tracing process is
not the old parent. Otherwise, proc_reap() will leave the zombie in place
resulting in the process' status being returned twice to its parent.

Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by
this change.

Differential Revision: https://reviews.freebsd.org/D2594
Reviewed by: kib
MFC after: 2 weeks
sys/kern/kern_exit.c
tests/sys/kern/Makefile
tests/sys/kern/ptrace_test.c [new file with mode: 0644]