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:
Konstantin Belousov 2019-02-03 21:31:40 +00:00
parent cbb65b7ec5
commit f02bc51c09

View File

@ -3112,8 +3112,8 @@ stop_all_proc(void)
PROC_UNLOCK(p);
continue;
}
_PHOLD(p);
sx_xunlock(&allproc_lock);
_PHOLD(p);
r = thread_single(p, SINGLE_ALLPROC);
if (r != 0)
restart = true;