HomeFreeBSD

processes: add zombie references, each of them prevents reap

Description

processes: add zombie references, each of them prevents reap

Add the p_zombieref bitmask into struct proc, which enumerates all
legitimate waiters on the process exit status. Among them are parent
for PZOMBIEREF_PARENT, and the holder of the process descriptor for
PZOMBIEREF_PROCDESC, if the process was created by pdfork().

Require all zombie refs to be cleared to reap zombie. This prevents
stealing the exit status from the parent by pdwait()ing on a procdesc
obtained by pdopenpid(), or by waitpid() by debugger from the real
parent.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58264

Details

Provenance
kibAuthored on Jul 15 2026, 5:30 PM
Reviewer
markj
Differential Revision
D58264: processes: add zombie references, each of them prevents reap
Parents
rG7da4edd30098: pdwait(2): change handling of the exited processes
Branches
Unknown
Tags
Unknown