[release/9.0-rc1] Remove CONTEXT_XSTATE in FaultingExceptionFrame::UpdateRegDisplay #106550
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
REGDISPLAY
from a faulting exception frame. The context stored in the frame can contain extended state, but we only copy the basicCONTEXT
part. But we are not removing theCONTEXT_XSTATE
flag. 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, theRtlRestoreContext
uses 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.