Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEPolicy::HandleFatalError calls RaiseFailFastException with invalid context #111182

Open
jkotas opened this issue Jan 8, 2025 · 2 comments
Open

Comments

@jkotas
Copy link
Member

jkotas commented Jan 8, 2025

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.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 8, 2025
Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member Author

jkotas commented Jan 8, 2025

Refer to internal email thread with title "KyRaiseException STATUS_SET_CONTEXT_DENIED" for more details.

@tommcdon tommcdon added this to the 10.0.0 milestone Jan 8, 2025
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants