mirror of
https://github.com/reactos/reactos.git
synced 2024-06-21 13:31:38 +00:00
[NTOS] Fix a bug in the PE loader, which caused images to be loaded up to MmHighestUserAddress, thus overwriting the shared user page.
This is now fixed by using MM_HIGHEST_VAD_ADDRESS as the margin instead. Should fix CORE-11717
This commit is contained in:
parent
3f1265f8c1
commit
56da95671c
|
@ -4579,11 +4579,11 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
|||
ImageSectionObject->ImageInformation.ImageFileSize = (ULONG)ImageSize;
|
||||
|
||||
/* Check for an illegal base address */
|
||||
if (((ImageBase + ImageSize) > (ULONG_PTR)MmHighestUserAddress) ||
|
||||
if (((ImageBase + ImageSize) > (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS) ||
|
||||
((ImageBase + ImageSize) < ImageSize))
|
||||
{
|
||||
ASSERT(*BaseAddress == NULL);
|
||||
ImageBase = ALIGN_DOWN_BY((ULONG_PTR)MmHighestUserAddress - ImageSize,
|
||||
ImageBase = ALIGN_DOWN_BY((ULONG_PTR)MM_HIGHEST_VAD_ADDRESS - ImageSize,
|
||||
MM_VIRTMEM_GRANULARITY);
|
||||
NotAtBase = TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue