mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS:MM] Properly handle execution in NX section
This prevents processes from looping forever, thinking the fault was already resolbed, because the page is writable.
This commit is contained in:
parent
fd3c571d36
commit
96c65e94e1
1 changed files with 11 additions and 2 deletions
|
@ -22,7 +22,8 @@ NTSTATUS
|
|||
NTAPI
|
||||
MmpAccessFault(KPROCESSOR_MODE Mode,
|
||||
ULONG_PTR Address,
|
||||
BOOLEAN FromMdl)
|
||||
BOOLEAN FromMdl,
|
||||
ULONG FaultCode)
|
||||
{
|
||||
PMMSUPPORT AddressSpace;
|
||||
MEMORY_AREA* MemoryArea;
|
||||
|
@ -36,6 +37,14 @@ MmpAccessFault(KPROCESSOR_MODE Mode,
|
|||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
|
||||
/* Instruction fetch and the page is present.
|
||||
This means the page is NX and we cannot do anything to "fix" it. */
|
||||
if (MI_IS_INSTRUCTION_FETCH(FaultCode))
|
||||
{
|
||||
DPRINT1("Page fault instruction fetch at %p\n", Address);
|
||||
return STATUS_ACCESS_VIOLATION;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the memory area for the faulting address
|
||||
*/
|
||||
|
@ -285,7 +294,7 @@ Retry:
|
|||
if (!MI_IS_NOT_PRESENT_FAULT(FaultCode))
|
||||
{
|
||||
/* Call access fault */
|
||||
Status = MmpAccessFault(Mode, (ULONG_PTR)Address, TrapInformation ? FALSE : TRUE);
|
||||
Status = MmpAccessFault(Mode, (ULONG_PTR)Address, TrapInformation ? FALSE : TRUE, FaultCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue