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
F168083898: D55341.id172142.diff
Wed, Aug 26, 7:29 AM
F168028102: D55341.id172150.diff
Wed, Aug 26, 12:27 AM
F167997397: D55341.diff
Tue, Aug 25, 8:20 PM
Unknown Object (File)
Tue, Aug 25, 12:20 AM
Unknown Object (File)
Mon, Aug 24, 1:47 AM
Unknown Object (File)
Mon, Aug 24, 12:25 AM
Unknown Object (File)
Sat, Aug 22, 12:39 AM
Unknown Object (File)
Sat, Aug 22, 12:27 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