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
F167471435: D55341.id172135.diff
Sat, Aug 22, 12:39 AM
F167470633: D55341.id172150.diff
Sat, Aug 22, 12:27 AM
F167468298: D55341.id172373.diff
Fri, Aug 21, 11:52 PM
F167463188: D55341.id172150.diff
Fri, Aug 21, 10:34 PM
F167463186: D55341.id172142.diff
Fri, Aug 21, 10:34 PM
F167463185: D55341.id172373.diff
Fri, Aug 21, 10:34 PM
F167463169: D55341.diff
Fri, Aug 21, 10:34 PM
Unknown Object (File)
Wed, Aug 19, 12:28 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

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