Protect the p->p_pgrp dereference with the process lock.

MFC after:	3 days
This commit is contained in:
kib 2013-01-06 15:10:10 +00:00
parent 184da5d83d
commit 69c365794c

View File

@ -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;
}