Author: cgutman
Date: Mon Aug 13 01:17:13 2012
New Revision: 57065
URL:
http://svn.reactos.org/svn/reactos?rev=57065&view=rev
Log:
[NTOSKRNL]
- Fix a critical bug in interrupt handling that could result in HAL returning the current
processor to the wrong IRQL after an interrupt is handled that requires a raise to a
synchronize IRQL.
Modified:
trunk/reactos/ntoskrnl/ke/i386/irqobj.c
Modified: trunk/reactos/ntoskrnl/ke/i386/irqobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irqobj.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/irqobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/irqobj.c [iso-8859-1] Mon Aug 13 01:17:13 2012
@@ -229,7 +229,7 @@
KiChainedDispatch(IN PKTRAP_FRAME TrapFrame,
IN PKINTERRUPT Interrupt)
{
- KIRQL OldIrql;
+ KIRQL OldIrql, OldInterruptIrql = 0;
BOOLEAN Handled;
PLIST_ENTRY NextEntry, ListHead;
@@ -250,7 +250,7 @@
if (Interrupt->SynchronizeIrql > Interrupt->Irql)
{
/* Raise to higher IRQL */
- OldIrql = KfRaiseIrql(Interrupt->SynchronizeIrql);
+ OldInterruptIrql = KfRaiseIrql(Interrupt->SynchronizeIrql);
}
/* Acquire interrupt lock */
@@ -267,7 +267,8 @@
if (Interrupt->SynchronizeIrql > Interrupt->Irql)
{
/* Lower the IRQL back */
- KfLowerIrql(OldIrql);
+ ASSERT(OldInterruptIrql == Interrupt->Irql);
+ KfLowerIrql(OldInterruptIrql);
}
/* Check if the interrupt got handled and it's level */