[NTOS]: Handle faults on non-demand-zero PTEs (and/or demand-zero PTEs that are not READWRITE (such as EXECUTE_READWRITE)).

svn path=/trunk/; revision=49186
This commit is contained in:
Sir Richard 2010-10-17 19:56:04 +00:00
parent ef0b6ce0bc
commit 3910f94f4a

View file

@ -929,11 +929,37 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
return STATUS_PAGE_FAULT_DEMAND_ZERO;
}
/* Don't handle prototype PTEs yet -- only kernel demand zero PTEs */
/* Get protection and check if it's a prototype PTE */
ProtectionCode = TempPte.u.Soft.Protection;
ASSERT(TempPte.u.Soft.Prototype == 0);
ASSERT(TempPte.u.Long == 0);
/* Check for non-demand zero PTE */
if (TempPte.u.Long != 0)
{
/* This is a page fault, check for valid protection */
ASSERT(ProtectionCode != 0x100);
/* FIXME: Run MiAccessCheck */
/* Dispatch the fault */
Status = MiDispatchFault(StoreInstruction,
Address,
PointerPte,
NULL,
FALSE,
PsGetCurrentProcess(),
TrapInformation,
NULL);
/* Return the status */
ASSERT(NT_SUCCESS(Status));
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
MiUnlockProcessWorkingSet(CurrentProcess, CurrentThread);
return Status;
}
/* Check if this address range belongs to a valid allocation (VAD) */
ASSERT(TempPte.u.Long == 0);
ProtoPte = MiCheckVirtualAddress(Address, &ProtectionCode, &Vad);
if (ProtectionCode == MM_NOACCESS)
{