https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0395049986556503da00c20dbfe69dc531984956

commit 0395049986556503da00c20dbfe69dc531984956
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Fri May 21 10:49:53 2021 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Fri May 21 10:52:55 2021 +0200

    [NTOS:KE] Do not call MmSetPageProtect for the Pentium Lock Errata
    
    CORE-17589
---
 ntoskrnl/ke/i386/cpu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ntoskrnl/ke/i386/cpu.c b/ntoskrnl/ke/i386/cpu.c
index 3b07453af53..bdc92f908fd 100644
--- a/ntoskrnl/ke/i386/cpu.c
+++ b/ntoskrnl/ke/i386/cpu.c
@@ -1089,6 +1089,7 @@ KiI386PentiumLockErrataFixup(VOID)
 {
     KDESCRIPTOR IdtDescriptor = {0, 0, 0};
     PKIDTENTRY NewIdt, NewIdt2;
+    PMMPTE PointerPte;
 
     /* Allocate memory for a new IDT */
     NewIdt = ExAllocatePool(NonPagedPool, 2 * PAGE_SIZE);
@@ -1114,7 +1115,10 @@ KiI386PentiumLockErrataFixup(VOID)
     _enable();
 
     /* Set the first 7 entries as read-only to produce a fault */
-    MmSetPageProtect(NULL, NewIdt, PAGE_READONLY);
+    PointerPte = MiAddressToPte(NewIdt);
+    ASSERT(PointerPte->u.Hard.Write == 1);
+    PointerPte->u.Hard.Write = 0;
+    KeInvalidateTlbEntry(NewIdt);
 }
 
 BOOLEAN

Reply via email to