[NTOS:KE] Do not allow waiting at IRQL >= DISPATCH_LEVEL when providing a timeout in KeWaitForMultipleObjects

CORE-6473
This commit is contained in:
Jérôme Gardou 2021-05-21 09:41:27 +02:00 committed by Jérôme Gardou
parent 27fcfe66a2
commit 41de1bd724

View file

@ -605,12 +605,9 @@ KeWaitForMultipleObjects(IN ULONG Count,
if (Thread->WaitNext)
ASSERT(KeGetCurrentIrql() == SYNCH_LEVEL);
else if (KeGetCurrentIrql() == DISPATCH_LEVEL &&
(!Timeout || Timeout->QuadPart != 0))
else if (!Timeout || (Timeout->QuadPart != 0))
{
/* HACK: tcpip is broken and waits with spinlocks acquired (CORE-6473) */
DPRINT("%s called at DISPATCH_LEVEL with non-zero timeout!\n",
__FUNCTION__);
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
}
else
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);