mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[NTOSKRNL]
Do not use image base addresses above MmHighestUserAddress in MmMapViewOfSection, because it would first succeed when checking for conflicting memory areas, and thus not try to find a better address, but later fail in MmMapViewOfSegment, which cannot create a memory area in system space (only possible with MmKernelAddressSpace / PsIdleProcess). See issue #5680 for more details. svn path=/trunk/; revision=54096
This commit is contained in:
parent
2e7ccdc07c
commit
a38e883762
1 changed files with 9 additions and 3 deletions
|
@ -4626,6 +4626,12 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
||||||
|
|
||||||
ImageSectionObject->ImageSize = (ULONG)ImageSize;
|
ImageSectionObject->ImageSize = (ULONG)ImageSize;
|
||||||
|
|
||||||
|
/* Check for an illegal base address */
|
||||||
|
if ((ImageBase + ImageSize) > (ULONG_PTR)MmHighestUserAddress)
|
||||||
|
{
|
||||||
|
ImageBase = PAGE_ROUND_DOWN((ULONG_PTR)MmHighestUserAddress - ImageSize);
|
||||||
|
}
|
||||||
|
|
||||||
/* Check there is enough space to map the section at that point. */
|
/* Check there is enough space to map the section at that point. */
|
||||||
if (MmLocateMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
|
if (MmLocateMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
|
||||||
PAGE_ROUND_UP(ImageSize)) != NULL)
|
PAGE_ROUND_UP(ImageSize)) != NULL)
|
||||||
|
|
Loading…
Reference in a new issue