-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Initial support for ptrauth qualified function pointers in C #63204
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
Merged
Conversation
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
@swift-ci test |
6aa5833
to
a286d14
Compare
aschwaighofer
approved these changes
Jan 25, 2023
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!
a286d14
to
40e845f
Compare
@swift-ci test and merge |
This will be used for supporting imported c function pointers with custom __ptrauth qualifier.
… with __ptrauth qualifier
…d field function pointers Access to such pointers are protected by begin_access [signed]/end_access. Generate code to auth/sign them before access.
40e845f
to
901c279
Compare
@swift-ci test and merge |
@swift-ci test macOS platform |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds support for ptrauth qualified non-address discriminated field function pointers in C. It consists of changes in SILGen and IRGen in order to support code generation of such pointers. This can be enabled by setting the flag
-enable-import-ptrauth-field-function-pointers
.Summary of changes:
QualType::getPointerAuth()
onclang::ValueDecl::getType()
to get pointer auth qualifier info from clangbegin_access [signed]/end_access
around access to signed field function pointersptrauth.auth
builtin before reading andptrauth.sign
for writing in to signed field function pointers using a shadow stack slot for translation.