Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2026 15:57:47 +0000
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 833bdae6c58b - main - proc_realparent(): do not mark the child as orphan when reparenting to p_opptr pid
Message-ID:  <6a6cc5fb.322a9.6720d56a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by kib:

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

commit 833bdae6c58bcede4d9d5e64612b34295558de0b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-31 02:04:05 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-07-31 15:57:31 +0000

    proc_realparent(): do not mark the child as orphan when reparenting to p_opptr pid
    
    Reported and reviewed by:       markj
    Fixes:  8cef3c9b768a ("proc_realparent(): assert that an orphaned child has real parent != parent")
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D58566
---
 sys/kern/kern_exit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index ebe4aa40c128..7fb3f115af9d 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1663,9 +1663,8 @@ proc_reparent(struct proc *child, struct proc *parent, bool set_oppid)
 	LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
 
 	proc_clear_orphan(child);
-	if ((child->p_flag & P_TRACED) != 0) {
+	if ((child->p_flag & P_TRACED) != 0 && child->p_oppid != parent->p_pid)
 		proc_add_orphan(child, child->p_pptr);
-	}
 
 	child->p_pptr = parent;
 	if (set_oppid)


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6cc5fb.322a9.6720d56a>