diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c
index 3e5f5797218..35eb58d05dc 100644
--- a/ntoskrnl/mm/i386/page.c
+++ b/ntoskrnl/mm/i386/page.c
@@ -19,6 +19,66 @@
 #error "Dude, fix your stuff before using this file"
 #endif
 
+/* CORE-17587 fun */
+#define PA_BIT_PRESENT   (0)
+#define PA_BIT_READWRITE (1)
+#define PA_BIT_USER      (2)
+#define PA_BIT_WT        (3)
+#define PA_BIT_CD        (4)
+#define PA_BIT_ACCESSED  (5)
+#define PA_BIT_DIRTY     (6)
+#define PA_BIT_GLOBAL    (8)
+
+#define PA_PRESENT   (1 << PA_BIT_PRESENT)
+#define PA_READWRITE (1 << PA_BIT_READWRITE)
+#define PA_USER      (1 << PA_BIT_USER)
+#define PA_DIRTY     (1 << PA_BIT_DIRTY)
+#define PA_WT        (1 << PA_BIT_WT)
+#define PA_CD        (1 << PA_BIT_CD)
+#define PA_ACCESSED  (1 << PA_BIT_ACCESSED)
+#define PA_GLOBAL    (1 << PA_BIT_GLOBAL)
+
+static ULONG
+ProtectToPTE(ULONG flProtect)
+{
+    ULONG Attributes = 0;
+
+    if (flProtect & (PAGE_NOACCESS|PAGE_GUARD))
+    {
+        Attributes = 0;
+    }
+    else if (flProtect & PAGE_IS_WRITABLE)
+    {
+        Attributes = PA_PRESENT | PA_READWRITE;
+    }
+    else if (flProtect & (PAGE_IS_READABLE | PAGE_IS_EXECUTABLE))
+    {
+        Attributes = PA_PRESENT;
+    }
+    else
+    {
+        DPRINT1("Unknown main protection type.\n");
+        KeBugCheck(MEMORY_MANAGEMENT);
+    }
+
+    if (flProtect & PAGE_SYSTEM)
+    {
+    }
+    else
+    {
+        Attributes = Attributes | PA_USER;
+    }
+    if (flProtect & PAGE_NOCACHE)
+    {
+        Attributes = Attributes | PA_CD;
+    }
+    if (flProtect & PAGE_WRITETHROUGH)
+    {
+        Attributes = Attributes | PA_WT;
+    }
+    return(Attributes);
+}
+
 /* GLOBALS *****************************************************************/
 const
 ULONG_PTR
@@ -540,6 +600,10 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process,
     /* Make sure our PDE is valid, and that everything is going fine */
     if (Process == NULL)
     {
+        /* We don't support this in legacy Mm for kernel mappings */
+        ASSERT(ProtectionMask != MM_WRITECOPY);
+        ASSERT(ProtectionMask != MM_EXECUTE_WRITECOPY);
+
         if (Address < MmSystemRangeStart)
         {
             DPRINT1("NULL process given for user-mode mapping at %p\n", Address);
@@ -567,13 +631,24 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process,
 
     PointerPte = MiAddressToPte(Address);
 
+    MI_MAKE_HARDWARE_PTE(&TempPte, PointerPte, ProtectionMask, Page);
     if (Address >= MmSystemRangeStart)
     {
-        MI_MAKE_HARDWARE_PTE_KERNEL(&TempPte, PointerPte, ProtectionMask, Page);
+        // MI_MAKE_HARDWARE_PTE_KERNEL(&TempPte, PointerPte, ProtectionMask, Page);
+        if (TempPte.u.Long != ((Page << PAGE_SHIFT) | ProtectToPTE(flProtect | PAGE_SYSTEM) | PA_ACCESSED))
+        {
+            DPRINT1("CORE-17587: TempPte.u.Long %lx, ancient value %lx\n", TempPte.u.Long, (Page << PAGE_SHIFT) | ProtectToPTE(flProtect | PAGE_SYSTEM));
+            ASSERT(TempPte.u.Long == ((Page << PAGE_SHIFT) | ProtectToPTE(flProtect | PAGE_SYSTEM)));
+        }
     }
     else
     {
-        MI_MAKE_HARDWARE_PTE_USER(&TempPte, PointerPte, ProtectionMask, Page);
+        // MI_MAKE_HARDWARE_PTE_USER(&TempPte, PointerPte, ProtectionMask, Page);
+        if (TempPte.u.Long != ((Page << PAGE_SHIFT) | ProtectToPTE(flProtect) | PA_ACCESSED))
+        {
+            DPRINT1("CORE-17587: TempPte.u.Long %lx, ancient value %lx\n", TempPte.u.Long, (Page << PAGE_SHIFT) | ProtectToPTE(flProtect));
+            ASSERT(TempPte.u.Long == ((Page << PAGE_SHIFT) | ProtectToPTE(flProtect)));
+        }
     }
 
     Pte = InterlockedExchangePte(PointerPte, TempPte.u.Long);
