[NTOS]: Handle faults on user-mode addresses, from user-mode processes, if they are...
authorSir Richard <sir_richard@svn.reactos.org>
Wed, 21 Jul 2010 18:09:31 +0000 (18:09 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Wed, 21 Jul 2010 18:09:31 +0000 (18:09 +0000)
svn path=/trunk/; revision=48164

reactos/ntoskrnl/mm/mmfault.c

index ab3f28f..50b5611 100644 (file)
@@ -284,6 +284,11 @@ MmAccessFault(IN BOOLEAN StoreInstruction,
      * can go away.
      */
     MemoryArea = MmLocateMemoryAreaByAddress(MmGetKernelAddressSpace(), Address);
+    if (!(MemoryArea) && (Address <= MM_HIGHEST_VAD_ADDRESS))
+    {
+        /* Could this be a VAD fault from user-mode? */
+        MemoryArea = MmLocateMemoryAreaByAddress(MmGetCurrentAddressSpace(), Address);
+    }
     if ((!(MemoryArea) && ((ULONG_PTR)Address >= (ULONG_PTR)MmPagedPoolStart)) ||
         ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3)))
     {
@@ -292,7 +297,7 @@ MmAccessFault(IN BOOLEAN StoreInstruction,
         //
         DPRINT("ARM3 fault %p\n", MemoryArea);
         return MmArmAccessFault(StoreInstruction, Address, Mode, TrapInformation);
-    }   
+    }
 
     /* Keep same old ReactOS Behaviour */
     if (StoreInstruction)