Check for PRS_NEW without locking the proc in sysctl_kern_proc

This commit is contained in:
Mateusz Guzik 2017-11-17 02:29:06 +00:00
parent bc24577c25
commit 997131646f

View File

@ -1479,11 +1479,9 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS)
/*
* Skip embryonic processes.
*/
PROC_LOCK(p);
if (p->p_state == PRS_NEW) {
PROC_UNLOCK(p);
if (p->p_state == PRS_NEW)
continue;
}
PROC_LOCK(p);
KASSERT(p->p_ucred != NULL,
("process credential is NULL for non-NEW proc"));
/*