Repository navigation
[release/9.0-rc1] Remove CONTEXT_XSTATE in FaultingExceptionFrame::UpdateRegDisplay - #106550
Merged
carlossanlop merged 1 commit intoAug 16, 2024
Merged
Conversation
Fixing the problem introduced by the previous attempt to fix that. The problem was that the CONTEXT_XSTATE contains not only the bit for the xstate, but also the architecture "id" (CONTEXT_AMD64, CONTEXT_ARM64, ...). I've verified this fix using the debugger tests that the previous change was breaking. There is a bug in updating REGDISPLAY from a faulting exception frame. The context stored in the frame can contain extended state, but we only copy the basic CONTEXT part. But we are not removing the CONTEXT_XSTATE flag. There was an issue found on arm64 Windows with SVE enabled. The context from a hardware exception contains the SVE extended state and when we resume after catch for the exception or start propagating it through native frames, the RtlRestoreContext uses some garbage to try to restore the extended state and ends up corrupting memory. The fix is to remove the CONTEXT_XSTATE flag from the context after we copy it to the REGDISPLAY. While we have hit this problem on Windows ARM64 with SVE only, I have made the same change for other targets that can have extended state too. Close #105483
Contributor
|
Tagging subscribers to this area: @mangod9 |
jkotas
approved these changes
Aug 16, 2024
jeffschwMSFT
approved these changes
Aug 16, 2024
jeffschwMSFT
left a comment
Member
There was a problem hiding this comment.
lgtm. we will take for consideration in rc1
Contributor
|
Approved by Tactics via email. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #106466 to release/9.0-rc1
/cc @janvorli
Customer Impact
There is a bug in updating
REGDISPLAYfrom a faulting exception frame. The context stored in the frame can contain extended state, but we only copy the basicCONTEXTpart. But we are not removing theCONTEXT_XSTATEflag. There was an issue found on arm64 Windows with SVE enabled by the folks working on enabling SVE on Windows. The context from a hardware exception contains the SVE extended state and when we resume after catch for the exception or start propagating it through native frames, theRtlRestoreContextuses some garbage to try to restore the extended state and ends up corrupting memory.Regression
Testing
The fix was verified on an actual SVE enabled Windows arm64 machine using a test provided by one of the folks working on the SVE enabling that was reliably failing without the fix.
Risk
Low. It just removes incorrect bit from the CONTEXT flags that would otherwise cause Windows to read garbage.