git: ef225a9dda66 - stable/15 - proc_realparent(): do not mark the child as orphan when reparenting to p_opptr pid

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a75a536.1d885.349b8c6d__40535.0291448244$1786094920$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by kib:

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

commit ef225a9dda66fc4902f1fbbd08fab808d44d8882
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-07-31 02:04:05 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-07 09:27:15 +0000

    proc_realparent(): do not mark the child as orphan when reparenting to p_opptr pid
    
    (cherry picked from commit 833bdae6c58bcede4d9d5e64612b34295558de0b)
---
 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 e702e70334a1..b20009f46139 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1666,9 +1666,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)
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.