Page MenuHomeFreeBSD

procctl(PROC_REAP_KILL): align error reporting with pgkill(2)
ClosedPublic

Authored by kib on Feb 18 2026, 8:26 AM.
Tags
None
Referenced Files
F167726979: D55341.id.diff
Mon, Aug 24, 1:47 AM
F167721246: D55341.id172150.diff
Mon, Aug 24, 12:25 AM
Unknown Object (File)
Sat, Aug 22, 12:39 AM
Unknown Object (File)
Sat, Aug 22, 12:27 AM
Unknown Object (File)
Fri, Aug 21, 11:52 PM
Unknown Object (File)
Fri, Aug 21, 10:34 PM
Unknown Object (File)
Fri, Aug 21, 10:34 PM
Unknown Object (File)
Fri, Aug 21, 10:34 PM
Subscribers

Details

Summary
ESRCH from cr_cansignal() means that the target process should be not
visible to the initiator.  So do not report pids with ESRCH result.

Noted by:       markj

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/kern/kern_procctl.c
270–274

Looks wrong. If ESRCH is returned, this code will still proceed to pksignal(), whereas the purpose of cr_cansignal() returning ESRCH is exactly to avoid the target being signaled.

kib marked an inline comment as done.

Return on any error, not excluding ESRCH.

Thank you. It looks right, I would add a short comment like /* Hide ESRCH errors to ensure that this function cannot be used as an oracle for process visibility. */

This revision is now accepted and ready to land.Feb 18 2026, 2:08 PM
This revision now requires review to proceed.Feb 18 2026, 2:20 PM
This revision is now accepted and ready to land.Feb 18 2026, 2:21 PM