aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-07-21 19:54:14 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-07-28 19:45:47 +0000
commit8cef3c9b768a4a6d63a7754f6a46315532687305 (patch)
treed4a774755031dcacd7c72453a7672997c774028d
parentce6ab51fc3784aec3d7501b50e7d2d0a75507a86 (diff)
proc_realparent(): assert that an orphaned child has real parent != parent
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58504
-rw-r--r--sys/kern/kern_exit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 2aa756bd00d2..c43bd69554e7 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);
}