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
Unknown Object (File)
Tue, Mar 17, 1:00 AM
Unknown Object (File)
Sat, Mar 14, 10:16 AM
Unknown Object (File)
Thu, Mar 12, 1:58 AM
Unknown Object (File)
Sat, Mar 7, 7:29 PM
Unknown Object (File)
Thu, Mar 5, 8:17 AM
Unknown Object (File)
Wed, Mar 4, 5:53 PM
Unknown Object (File)
Wed, Mar 4, 12:29 PM
Unknown Object (File)
Mon, Mar 2, 2:28 AM
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 Not Applicable
Unit
Tests Not Applicable

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