Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Feb 2019 21:31:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343724 - head/sys/kern
Message-ID:  <201902032131.x13LVeab029218@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Feb  3 21:31:40 2019
New Revision: 343724
URL: https://svnweb.freebsd.org/changeset/base/343724

Log:
  Do not call PHOLD() while owning the allproc_lock sx.
  
  Otherwise the lock might recurse in faultin() if the process is
  swapped out.
  
  Reported by:	zeising
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Sun Feb  3 21:28:58 2019	(r343723)
+++ head/sys/kern/kern_proc.c	Sun Feb  3 21:31:40 2019	(r343724)
@@ -3112,8 +3112,8 @@ allproc_loop:
 			PROC_UNLOCK(p);
 			continue;
 		}
-		_PHOLD(p);
 		sx_xunlock(&allproc_lock);
+		_PHOLD(p);
 		r = thread_single(p, SINGLE_ALLPROC);
 		if (r != 0)
 			restart = true;



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