[NTOSKRNL]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 27 Feb 2011 15:16:00 +0000 (15:16 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 27 Feb 2011 15:16:00 +0000 (15:16 +0000)
Fix a serious bug, where NtAllocateVirtualMemory could allocate memory user mode memory above MmHighestUserAddress up to MmSystemRangeStart - 1, which is a no-access area.

svn path=/trunk/; revision=50917

reactos/ntoskrnl/mm/marea.c

index cacf2ae..dc50d13 100644 (file)
@@ -458,7 +458,7 @@ MmFindGapBottomUp(
 {
    PVOID LowestAddress  = MmGetAddressSpaceOwner(AddressSpace) ? MM_LOWEST_USER_ADDRESS : MmSystemRangeStart;
    PVOID HighestAddress = MmGetAddressSpaceOwner(AddressSpace) ?
-                          (PVOID)((ULONG_PTR)MmSystemRangeStart - 1) : (PVOID)MAXULONG_PTR;
+                            MmHighestUserAddress : (PVOID)MAXULONG_PTR;
    PVOID AlignedAddress;
    PMEMORY_AREA Node;
    PMEMORY_AREA FirstNode;