Skip to content

[embedded] Resolve ptrauth crashes by signing HeapObjects's isa pointers in embedded Swift #71076

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
Jan 23, 2024

Conversation

kubamracek
Copy link
Contributor

Virtual function calls verify isa signatures even in non-objc-interop mode on Embedded Swift, so we need to sign isa pointers in swift_allocObject and friends.

rdar://121398826

@kubamracek kubamracek requested a review from a team as a code owner January 23, 2024 00:48
@kubamracek
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Is it possible to use SpecialPointerAuthDiscriminators::ObjCISA and SpecialPointerAuthDiscriminators::HeapDestructor rather than the magic numbers? Might not be possible to get at those definitions from here.

@kubamracek
Copy link
Contributor Author

Is it possible to use SpecialPointerAuthDiscriminators::ObjCISA and SpecialPointerAuthDiscriminators::HeapDestructor rather than the magic numbers? Might not be possible to get at those definitions from here.

Not without some larger refactoring: MetadataValues.h is a C++ header (and SpecialPointerAuthDiscriminators is a namespace), but this EmbeddedShims.h header is a C header (and needs to stay as C to be importable to Swift). I'll try to think about what can be done about this later.

@kubamracek kubamracek merged commit 3659ea7 into swiftlang:main Jan 23, 2024
@mikeash
Copy link
Contributor

mikeash commented Jan 23, 2024

Makes sense. Not a big deal, it’s not like these numbers will ever change.

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