Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jan 2013 15:10:11 +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: r245104 - head/sys/kern
Message-ID:  <201301061510.r06FABnq085646@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Jan  6 15:10:10 2013
New Revision: 245104
URL: http://svnweb.freebsd.org/changeset/base/245104

Log:
  Protect the p->p_pgrp dereference with the process lock.
  
  MFC after:	3 days

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c	Sun Jan  6 15:07:19 2013	(r245103)
+++ head/sys/kern/kern_exit.c	Sun Jan  6 15:10:10 2013	(r245104)
@@ -1074,7 +1074,9 @@ kern_wait6(struct thread *td, idtype_t i
 	q = td->td_proc;
 
 	if ((pid_t)id == WAIT_MYPGRP && (idtype == P_PID || idtype == P_PGID)) {
+		PROC_LOCK(q);
 		id = (id_t)q->p_pgid;
+		PROC_UNLOCK(q);
 		idtype = P_PGID;
 	}
 



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