Skip to content

EEPolicy::HandleFatalError calls RaiseFailFastException with invalid context #111182

Description

@jkotas

CONTEXT is captured here:

ClrCaptureContext(&context);

And then passed to RaiseFailFastException here:

pExceptionInfo == NULL ? NULL : pExceptionInfo->ContextRecord,

Stacktrace:

KERNELBASE!RaiseFailFastException
coreclr!WatsonLastChance+0x1b3 [D:\a\_work\1\s\src\coreclr\vm\excep.cpp @ 3590] 
coreclr!EEPolicy::LogFatalError+0x6b4 [D:\a\_work\1\s\src\coreclr\vm\eepolicy.cpp @ 589] 
coreclr!EEPolicy::HandleFatalError+0x133 [D:\a\_work\1\s\src\coreclr\vm\eepolicy.cpp @ 828]

The problem is that RaiseFailFastException validates that the context matches a valid return address on the stack as part of CET. If the context is not valid, it rejects it, flags it as a potential attack and asserts in checked builds of Windows OS.

We should stop passing invalid CONTEXT to RaiseFailFastException and verify that the Watson bucketing of the crashes originating in EEPolicy::HandleFatalError works as expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions