Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[6.2][Concurrency] Use reinterpret_cast for function_cast when ptrauth is on. #81383

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

Open
wants to merge 1 commit into
base: release/6.2
Choose a base branch
from

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented May 8, 2025

Cherry-pick #81380 to release/6.2.

We need to use reinterpret_cast when ptrauth is enabled to ensure that any necessary auth-and-sign operations are performed.

rdar://150747009

…h is on.

We need to use reinterpret_cast when ptrauth is enabled to ensure that any necessary auth-and-sign operations are performed.

rdar://150747009
(cherry picked from commit 0f2b047)
@mikeash mikeash requested a review from a team as a code owner May 8, 2025 21:16
@mikeash
Copy link
Contributor Author

mikeash commented May 8, 2025

@swift-ci please test

@mikeash
Copy link
Contributor Author

mikeash commented May 8, 2025

Explanation: PAC needs function pointers to be authenticated and re-signed when converting between different function pointer types in some cases. The function_cast function wasn't doing that. This fixes it so it does.
Scope: Without this, the Concurrency runtime is broken on affected targets.
Issue: rdar://150747009
Risk: Very low. Without PAC, the code is unchanged. With PAC, incorrect cases become correct.
Testing: Inspected codegen to ensure it's correct. Concurrency tests ensure this doesn't break anything new.
Reviewer: @ktoso

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.

2 participants