Commit 0f2b659
committed
[PtrAuth] Pass discriminator to swift_suspend_dispatch.
Previously, swift_suspend_dispatch was passed a pointer to a function
and createAsyncDispatchFn was passed a FunctionPointer. The latter
constructed a new FunctionPointer using the passed-in function pointer
as the value, because the value inside the FunctionPointer was a value
in a different function.
That worked fine on platforms without pointer authentication. On
arm64e, however, calling a function can use two values from a
FunctionPointer: the pointer to the function and the discriminator. The
result was that on arm64e, swift_suspend_dispatch failed verification
because the discriminator value that was used in the call made by
swift_suspend_dispatch did not originate in that function.
Here, that problem is resolved by passing the discriminator to
swift_suspend_dispatch. Now, createAsyncDispatchFn creates a
FunctionPointer using not just the passed-in function pointer but also
the passed-in discriminator. The result is that swift_suspend_dispatch
no longer fails verification.1 parent b8ec80a commit 0f2b659
2 files changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2480 | 2480 | | |
2481 | 2481 | | |
2482 | 2482 | | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
2483 | 2486 | | |
2484 | 2487 | | |
2485 | 2488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2418 | 2418 | | |
2419 | 2419 | | |
2420 | 2420 | | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
2421 | 2425 | | |
2422 | 2426 | | |
2423 | 2427 | | |
| |||
2437 | 2441 | | |
2438 | 2442 | | |
2439 | 2443 | | |
2440 | | - | |
| 2444 | + | |
| 2445 | + | |
2441 | 2446 | | |
2442 | 2447 | | |
2443 | 2448 | | |
2444 | 2449 | | |
2445 | | - | |
2446 | | - | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
2447 | 2456 | | |
2448 | 2457 | | |
2449 | 2458 | | |
| |||
0 commit comments