git: af495ad4a98a - stable/15 - proc_realparent(): assert that an orphaned child has real parent != parent

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a75a535.1e11f.5087926e__14794.3900361255$1786094913$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=af495ad4a98acfb391184c4f16d68e314a3b92e7

commit af495ad4a98acfb391184c4f16d68e314a3b92e7
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-07-21 19:54:14 +0000
Commit:     Konstantin Belousov <[email protected]>
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);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.