]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Set the p_oppid field of orphans when exiting.
authormarkj <markj@FreeBSD.org>
Sun, 7 Apr 2019 14:26:14 +0000 (14:26 +0000)
committermarkj <markj@FreeBSD.org>
Sun, 7 Apr 2019 14:26:14 +0000 (14:26 +0000)
commit6e75ac3373eb1be88eb4e4593983f55503cf3c23
tree55ad961c796c168419b444fcd202b16e3a2cf327
parent76764ecd98220cf5e0a6fcf686f2f73ccf6ac353
Set the p_oppid field of orphans when exiting.

Such processes will be reparented to the reaper when the current
parent is done with them (i.e., ptrace detached), so p_oppid must be
updated accordingly.

Add a regression test to exercise this code path.  Previously it
would not be possible to reap an orphan with a stale oppid.

Reviewed by: kib, mjg
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19825
sys/kern/kern_exit.c
tests/sys/kern/ptrace_test.c