-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[NativeAOT] Adjust SSP to match RSP of the throw site #119167
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
Conversation
This fixes unbounded shadow stack growth that leads to stack overflow exception when exceptions are thrown and caught in a loop. Fixes dotnet#118913 Fixes dotnet#107418
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes unbounded shadow stack growth in NativeAOT that was causing stack overflow exceptions when exceptions are thrown and caught in loops. The fix adjusts the Shadow Stack Pointer (SSP) to properly match the Regular Stack Pointer (RSP) at the throw site, preventing stack accumulation during exception handling.
- Adds SSP adjustment logic to align with RSP at throw sites
- Removes exclusion of previously failing test case that is now fixed
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/tests/issues.targets | Removes test exclusion for NativeAOT ControlFlowGuard issue that is now resolved |
src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm | Adds SSP adjustment logic in RhpThrowEx and RhpRethrow functions to prevent unbounded shadow stack growth |
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17307854868 |
This fixes unbounded shadow stack growth that leads to stack overflow exception when exceptions are thrown and caught in a loop.
Fixes #118913
Fixes #107418