Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2017 02:29:06 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325923 - head/sys/kern
Message-ID:  <201711170229.vAH2T6lH047146@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Nov 17 02:29:06 2017
New Revision: 325923
URL: https://svnweb.freebsd.org/changeset/base/325923

Log:
  Check for PRS_NEW without locking the proc in sysctl_kern_proc

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Fri Nov 17 02:27:04 2017	(r325922)
+++ head/sys/kern/kern_proc.c	Fri Nov 17 02:29:06 2017	(r325923)
@@ -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"));
 			/*



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