summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-01-06 15:10:10 +0000
committerkib <kib@FreeBSD.org>2013-01-06 15:10:10 +0000
commit69c365794c93320ef1fc4a2b569b4cbee62d53a0 (patch)
tree47395b94b0330be0494317c7bbcf55096503facc
parent184da5d83da91fd08fa89f0ea9c2453c3cdf98b7 (diff)
downloadFreeBSD-src-69c365794c93320ef1fc4a2b569b4cbee62d53a0.zip
FreeBSD-src-69c365794c93320ef1fc4a2b569b4cbee62d53a0.tar.gz
Protect the p->p_pgrp dereference with the process lock.
MFC after: 3 days
-rw-r--r--sys/kern/kern_exit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 3dd6521..50b47fb 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1074,7 +1074,9 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status,
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;
}
OpenPOWER on IntegriCloud