[NTOS:KE]

- Make fastfail exception noncontinuable
CORE-8419

svn path=/trunk/; revision=64685
This commit is contained in:
Thomas Faber 2014-10-11 23:07:04 +00:00
parent d52bd15a34
commit 40b5bdc561
3 changed files with 16 additions and 8 deletions

View file

@ -504,6 +504,7 @@ VOID
NTAPI
KiDispatchExceptionFromTrapFrame(
IN NTSTATUS Code,
IN ULONG Flags,
IN ULONG_PTR Address,
IN ULONG ParameterCount,
IN ULONG_PTR Parameter1,
@ -623,7 +624,7 @@ KiDispatchException0Args(IN NTSTATUS Code,
IN PKTRAP_FRAME TrapFrame)
{
/* Helper for exceptions with no arguments */
KiDispatchExceptionFromTrapFrame(Code, Address, 0, 0, 0, 0, TrapFrame);
KiDispatchExceptionFromTrapFrame(Code, 0, Address, 0, 0, 0, 0, TrapFrame);
}
//
@ -638,7 +639,7 @@ KiDispatchException1Args(IN NTSTATUS Code,
IN PKTRAP_FRAME TrapFrame)
{
/* Helper for exceptions with no arguments */
KiDispatchExceptionFromTrapFrame(Code, Address, 1, P1, 0, 0, TrapFrame);
KiDispatchExceptionFromTrapFrame(Code, 0, Address, 1, P1, 0, 0, TrapFrame);
}
//
@ -654,7 +655,7 @@ KiDispatchException2Args(IN NTSTATUS Code,
IN PKTRAP_FRAME TrapFrame)
{
/* Helper for exceptions with no arguments */
KiDispatchExceptionFromTrapFrame(Code, Address, 2, P1, P2, 0, TrapFrame);
KiDispatchExceptionFromTrapFrame(Code, 0, Address, 2, P1, P2, 0, TrapFrame);
}
//

View file

@ -1097,6 +1097,7 @@ DECLSPEC_NORETURN
VOID
NTAPI
KiDispatchExceptionFromTrapFrame(IN NTSTATUS Code,
IN ULONG Flags,
IN ULONG_PTR Address,
IN ULONG ParameterCount,
IN ULONG_PTR Parameter1,
@ -1108,7 +1109,7 @@ KiDispatchExceptionFromTrapFrame(IN NTSTATUS Code,
/* Build the exception record */
ExceptionRecord.ExceptionCode = Code;
ExceptionRecord.ExceptionFlags = 0;
ExceptionRecord.ExceptionFlags = Flags;
ExceptionRecord.ExceptionRecord = NULL;
ExceptionRecord.ExceptionAddress = (PVOID)Address;
ExceptionRecord.NumberParameters = ParameterCount;

View file

@ -223,6 +223,7 @@ KiDebugHandler(IN PKTRAP_FRAME TrapFrame,
/* Dispatch the exception */
KiDispatchExceptionFromTrapFrame(STATUS_BREAKPOINT,
0,
TrapFrame->Eip - 1,
3,
Parameter1,
@ -1311,6 +1312,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
/* Only other choice is an in-page error, with 3 parameters */
KiDispatchExceptionFromTrapFrame(STATUS_IN_PAGE_ERROR,
0,
TrapFrame->Eip,
3,
TrapFrame->ErrCode & 2 ? TRUE : FALSE,
@ -1474,10 +1476,14 @@ KiRaiseSecurityCheckFailureHandler(IN PKTRAP_FRAME TrapFrame)
if (KiUserTrap(TrapFrame))
{
/* Dispatch exception to user mode */
KiDispatchException1Args(STATUS_STACK_BUFFER_OVERRUN,
TrapFrame->Eip,
TrapFrame->Ecx,
TrapFrame);
KiDispatchExceptionFromTrapFrame(STATUS_STACK_BUFFER_OVERRUN,
EXCEPTION_NONCONTINUABLE,
TrapFrame->Eip,
1,
TrapFrame->Ecx,
0,
0,
TrapFrame);
}
else
{