git: 6cd0117bdb2c - stable/14 - exit1(): Ensure that SIGCHLD from reparented child is queued to reaper
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 Jun 2025 04:48:40 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=6cd0117bdb2c4b90cb31f90712431fbe125d9755
commit 6cd0117bdb2c4b90cb31f90712431fbe125d9755
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-06-08 07:31:28 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-06-12 04:28:27 +0000
exit1(): Ensure that SIGCHLD from reparented child is queued to reaper
(cherry picked from commit 8dda34d0ef79d0d247b3487ae0499bdf12c9209e)
---
sys/kern/kern_sig.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index cc0aecbc7756..0291c2647da6 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -3751,7 +3751,14 @@ sigparent(struct proc *p, int reason, int status)
if (KSI_ONQ(p->p_ksi))
return;
}
- pksignal(p->p_pptr, SIGCHLD, p->p_ksi);
+
+ /*
+ * Do not consume p_ksi if parent is zombie, since signal is
+ * dropped immediately. Instead, keep it since it might be
+ * useful for reaper.
+ */
+ if (p->p_pptr->p_state != PRS_ZOMBIE)
+ pksignal(p->p_pptr, SIGCHLD, p->p_ksi);
}
static void