git: fe90ad2d2444 - stable/15 - procctl(PROC_REAP_KILL): align error reporting with pgkill(2)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 28 Feb 2026 01:33:18 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=fe90ad2d2444616d01d0d5396c0687635d637364
commit fe90ad2d2444616d01d0d5396c0687635d637364
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-02-18 08:22:51 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-02-28 01:32:25 +0000
procctl(PROC_REAP_KILL): align error reporting with pgkill(2)
(cherry picked from commit 5c8af592f69a31da94c45722dcd74afcf0ab375e)
---
sys/kern/kern_procctl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c
index 30ab37d56877..b1539c5cec4f 100644
--- a/sys/kern/kern_procctl.c
+++ b/sys/kern/kern_procctl.c
@@ -267,7 +267,11 @@ reap_kill_proc_locked(struct reap_kill_proc_work *w)
error = cr_cansignal(w->cr, w->target, w->rk->rk_sig);
if (error != 0) {
- if (*w->error == ESRCH) {
+ /*
+ * Hide ESRCH errors to ensure that this function
+ * cannot be used as an oracle for process visibility.
+ */
+ if (error != ESRCH && *w->error == 0) {
w->rk->rk_fpid = w->target->p_pid;
*w->error = error;
}