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
This commit is contained in:
kib 2019-02-03 21:31:40 +00:00
parent 38b15fd590
commit c53856ffbf

View File

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