Check for PRS_NEW without locking the proc in sysctl_kern_proc

This commit is contained in:
mjg 2017-11-17 02:29:06 +00:00
parent 2cadb364c5
commit 4688365465

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"));
/*