mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[NTOS/MM] Properly handle page faults in regions marked with
PAGE_NOACCESS or PAGE_GUARD ROSTESTS-110
This commit is contained in:
parent
47ac7a2b28
commit
df25e4e791
|
@ -1410,6 +1410,29 @@ MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace,
|
|||
&MemoryArea->Data.SectionData.RegionListHead,
|
||||
Address, NULL);
|
||||
ASSERT(Region != NULL);
|
||||
|
||||
/* Check for a NOACCESS mapping */
|
||||
if (Region->Protect & PAGE_NOACCESS)
|
||||
{
|
||||
return STATUS_ACCESS_VIOLATION;
|
||||
}
|
||||
|
||||
if (Region->Protect & PAGE_GUARD)
|
||||
{
|
||||
/* Remove it */
|
||||
Status = MmAlterRegion(AddressSpace, (PVOID)MA_GetStartingAddress(MemoryArea),
|
||||
&MemoryArea->Data.SectionData.RegionListHead,
|
||||
Address, PAGE_SIZE, Region->Type, Region->Protect & ~PAGE_GUARD,
|
||||
MmAlterViewAttributes);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Removing PAGE_GUARD protection failed : 0x%08x.\n", Status);
|
||||
}
|
||||
|
||||
return STATUS_GUARD_PAGE_VIOLATION;
|
||||
}
|
||||
|
||||
/*
|
||||
* Lock the segment
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue