-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[NativeAOT] Adding CET support #102680
Merged
Merged
[NativeAOT] Adding CET support #102680
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ecb5c6c
Add support for STATUS_RETURN_ADDRESS_HIJACK_ATTEMPT
VSadov a56e166
fix build with clang
VSadov 0f0c3b6
Allow hijacked returns that land in assembly thunks
VSadov e69f551
fix x86 build
VSadov c518684
fail fast if hijack is hit on an unhijacked thread.
VSadov 0ab6e40
comment
VSadov f0193bf
assert that OS unhijacked the thread to the same target as stashed by…
VSadov bd1ac22
opt into CETCOMPAT by default
VSadov 3411400
unify adjustment for thunks
VSadov 931e37e
Use CETCompat as condition. Narrow to x64.
VSadov 7711ad8
Enable EHCONT, if CET and CFG are enabled
VSadov a0c798b
tweak comments
VSadov c991f59
Reconcile shadow stack with SP changes in RhpCallCatchFunclet
VSadov af84a14
Use RhFailFast for failfast
VSadov 125b742
drop __fastcall in HijackFunc
VSadov 4daf9cd
Apply suggestions from code review
VSadov ca52149
remove fastcall from RhpHijackForGcStress
VSadov 024208a
Apply suggestions from code review
VSadov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow hijacked returns that land in assembly thunks
- Loading branch information
commit 0f0c3b6bb93f69e5a0b35011b772f332ae97674d
There are no files selected for viewing
This file contains 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
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.
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.
I am not sure how this is related to the CET stuff
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.
InternalInit is supposed to leave the iterator in managed code. Until this change the InternalInit that takes
NATIVE_CONTEXT
was always starting from a location that is already in managed code. (unlike the one that takesPInvokeTransitionFrame
)Now, when we receive hijack exception, we pop to the caller and perform suspension in the caller's context.
Typically managed method that is not a reverse PInvoke must only be called by another managed method, so that would require no changes here. There are rare cases though in NativeAOT when ordinary managed methods are called from asm thunks. So it becomes possible for this code to see a location in a thunk. That is handled in the same way as in the other InternalInit method. (i.e. via
UnwindNonEHThunkSequence
)Perhaps I should unify this code into a helper to not duplicate it in both InternalInit methods.
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.
I've unified the adjustment for asm thunks