git: af495ad4a98a - stable/15 - proc_realparent(): assert that an orphaned child has real parent != parent
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 07 Aug 2026 09:28:21 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=af495ad4a98acfb391184c4f16d68e314a3b92e7
commit af495ad4a98acfb391184c4f16d68e314a3b92e7
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-21 19:54:14 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-08-07 09:27:14 +0000
proc_realparent(): assert that an orphaned child has real parent != parent
(cherry picked from commit 8cef3c9b768a4a6d63a7754f6a46315532687305)
---
sys/kern/kern_exit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 757428826f96..e702e70334a1 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -124,6 +124,9 @@ proc_realparent(struct proc *child)
}
parent = __containerof(p->p_orphan.le_prev, struct proc,
p_orphans.lh_first);
+ KASSERT(child->p_pptr != parent,
+ ("proc %d %p orphaned but parent %d %p is realparent",
+ child->p_pid, child, parent->p_pid, parent));
return (parent);
}