Skip to content

[Runtime][IRGen] Sign type context descriptor pointers. #67168

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
merged 1 commit into from
Jul 11, 2023

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Jul 6, 2023

Ensure that context descriptor pointers are signed in the runtime by putting the ptrauth_struct attribute on the types.

We use the new __builtin_ptrauth_struct_key/disc to conditionally apply ptrauth_struct to TrailingObjects based on the signing of the base type, so that pointers to TrailingObjects get signed when used with a context descriptor pointer.

We add new runtime entrypoints that take signed pointers where appropriate, and have the compiler emit calls to the new entrypoints when targeting a sufficiently new OS.

rdar://111480914

@mikeash mikeash requested a review from aschwaighofer July 6, 2023 20:49
@mikeash mikeash force-pushed the ptrauth-struct-context-descriptors branch from 85b1508 to 69662f3 Compare July 6, 2023 20:56
@mikeash
Copy link
Contributor Author

mikeash commented Jul 7, 2023

@swift-ci please test

@mikeash mikeash force-pushed the ptrauth-struct-context-descriptors branch 2 times, most recently from 1b5abc2 to 1a5ff19 Compare July 7, 2023 17:26
@mikeash
Copy link
Contributor Author

mikeash commented Jul 7, 2023

@swift-ci please test

Ensure that context descriptor pointers are signed in the runtime by putting the ptrauth_struct attribute on the types.

We use the new __builtin_ptrauth_struct_key/disc to conditionally apply ptrauth_struct to TrailingObjects based on the signing of the base type, so that pointers to TrailingObjects get signed when used with a context descriptor pointer.

We add new runtime entrypoints that take signed pointers where appropriate, and have the compiler emit calls to the new entrypoints when targeting a sufficiently new OS.

rdar://111480914
@mikeash mikeash force-pushed the ptrauth-struct-context-descriptors branch from 1a5ff19 to fe7e13b Compare July 7, 2023 22:10
@mikeash
Copy link
Contributor Author

mikeash commented Jul 7, 2023

@swift-ci please test

@aschwaighofer
Copy link
Contributor

could you run the preset that corresponds to https://ci.swift.org/job/oss-swift_tools-RA_stdlib-DA_test-device-non_executable/

It could be that some tests on iphoneos-arm64e might need updating

@mikeash
Copy link
Contributor Author

mikeash commented Jul 8, 2023

preset=buildbot,tools=RA,stdlib=RD,test=non_executable
@swift-ci please test with preset

@mikeash
Copy link
Contributor Author

mikeash commented Jul 8, 2023

From the failures I got before, I think PR testing covers iOS ARM64e non-executable tests, but I'll run that preset too just to make sure.

@mikeash
Copy link
Contributor Author

mikeash commented Jul 8, 2023

@swift-ci please test windows platform

@shahmishal
Copy link
Member

@swift-ci please test windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants