[NTOS] Treat page faults with interrupts disabled as access violation
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 23 Jul 2022 10:42:20 +0000 (12:42 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 4 Aug 2022 14:15:24 +0000 (16:15 +0200)
ntoskrnl/ke/amd64/trap.S

index 0b4f037..7347036 100644 (file)
@@ -428,6 +428,10 @@ FUNC KiPageFault
     /* Save page fault address */
     mov rdx, cr2
     mov [rbp  + KTRAP_FRAME_FaultAddress], rdx
+    
+    /* If interrupts are off, treat this as an access violation */
+    test dword ptr [rbp + KTRAP_FRAME_EFlags], EFLAGS_IF_MASK
+    jz AccessViolation
 
     /* Enable interrupts for the page fault handler */
     sti