svn commit: r366080 - stable/12/sys/kern

Konstantin Belousov kib at FreeBSD.org
Wed Sep 23 17:13:00 UTC 2020


Author: kib
Date: Wed Sep 23 17:12:59 2020
New Revision: 366080
URL: https://svnweb.freebsd.org/changeset/base/366080

Log:
  MFC r365812:
  proc_realparent: if p_oppid does not match pid of the current parent
  for non-orphaned process, return reaper instead of init.

Modified:
  stable/12/sys/kern/kern_exit.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_exit.c
==============================================================================
--- stable/12/sys/kern/kern_exit.c	Wed Sep 23 17:11:06 2020	(r366079)
+++ stable/12/sys/kern/kern_exit.c	Wed Sep 23 17:12:59 2020	(r366080)
@@ -109,7 +109,7 @@ proc_realparent(struct proc *child)
 	sx_assert(&proctree_lock, SX_LOCKED);
 	if ((child->p_treeflag & P_TREE_ORPHANED) == 0)
 		return (child->p_pptr->p_pid == child->p_oppid ?
-			    child->p_pptr : initproc);
+		    child->p_pptr : child->p_reaper);
 	for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) {
 		/* Cannot use LIST_PREV(), since the list head is not known. */
 		p = __containerof(p->p_orphan.le_prev, struct proc,


More information about the svn-src-stable-12 mailing list