Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2012 22:00:47 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232947 - head/sys/kern
Message-ID:  <201203132200.q2DM0loJ064851@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Mar 13 22:00:46 2012
New Revision: 232947
URL: http://svn.freebsd.org/changeset/base/232947

Log:
  Lock the process around manipulations with p_flag.
  
  Reported and reviewed by:	jh
  MFC after:	3 days

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c	Tue Mar 13 21:25:25 2012	(r232946)
+++ head/sys/kern/kern_exit.c	Tue Mar 13 22:00:46 2012	(r232947)
@@ -738,10 +738,12 @@ proc_reap(struct thread *td, struct proc
 	LIST_REMOVE(p, p_list);	/* off zombproc */
 	sx_xunlock(&allproc_lock);
 	LIST_REMOVE(p, p_sibling);
+	PROC_LOCK(p);
 	if (p->p_flag & P_ORPHAN) {
 		LIST_REMOVE(p, p_orphan);
 		p->p_flag &= ~P_ORPHAN;
 	}
+	PROC_UNLOCK(p);
 	leavepgrp(p);
 #ifdef PROCDESC
 	if (p->p_procdesc != NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203132200.q2DM0loJ064851>