Skip to content

[release/9.0] Fix SSP issue with HW exceptions from JIT helpers#107676

Merged
jeffschwMSFT merged 3 commits intorelease/9.0from
backport/pr-107665-to-release/9.0
Sep 11, 2024
Merged

[release/9.0] Fix SSP issue with HW exceptions from JIT helpers#107676
jeffschwMSFT merged 3 commits intorelease/9.0from
backport/pr-107665-to-release/9.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Backport of #107665 to release/9.0

/cc @janvorli

Customer Impact

  • Customer reported
  • Found internally

[Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.]

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

[How was the fix verified? How was the issue missed previously? What tests were added?]

Risk

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

The recent change that was fixing bad SSP updating during exception
handling with funceval has also modified the way SSP is extracted for
hardware exceptions. That works fine for many cases, but there is a
problem when the exception occurs in a JIT helper. The
`AjustContextForJITHelpers` uses only the basic `CONTEXT` structure for
unwinding to the managed caller and so the SSP is not properly updated.
That makes it off by one slot when we set it when continuing execution
after catch.
This change removes storing SSP for hardware exceptions in the
FaultingExceptionFrame to mitigate the issue. It effectively returns to
the way software exceptions use - scanning shadow stack for the
instruction pointer of the frame to which it is going to resume after
catch.
@ghost ghost added the area-VM-coreclr label Sep 11, 2024
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

@janvorli janvorli requested a review from jkotas September 11, 2024 11:39
@janvorli janvorli added this to the 9.0.0 milestone Sep 11, 2024
@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Sep 11, 2024
Copy link
Copy Markdown
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. please get a code review. when ready we can merge

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants