Use hint-safe pointer authentication stripping in NativeAOT#130474
Merged
Conversation
Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Copilot
AI
changed the title
[WIP] Fix PacStripPtr execution on tvOS without pointer authentication
Use hint-safe pointer authentication stripping in NativeAOT
Jul 10, 2026
Member
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Contributor
|
The fix LGTM! |
jkotas
approved these changes
Jul 10, 2026
Contributor
|
Failure seem unrelated, no SIGILL or Illegal Instruction failures. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates NativeAOT’s ARM64 PacStripPtr helper to use the same hint-safe pointer-authentication stripping sequence used by CoreCLR, avoiding execution of xpaci x0 and instead using xpaclri while preserving the caller’s lr.
Changes:
- Replace the Unix ARM64
PacStripPtrleaf stub (xpaci x0; ret) with a nested prolog/epilog that savesfp/lr, routes the input pointer throughlr, executesxpaclri, and returns the stripped pointer inx0. - Apply the same change to the Windows ARM64 stub, encoding
xpaclrias a raw instruction word (consistent with existing PAC instruction encoding patterns in that file).
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/nativeaot/Runtime/arm64/MiscStubs.S | Switches PacStripPtr to a CoreCLR-matching, hint-safe xpaclri sequence with proper lr preservation/unwind-friendly prolog/epilog. |
| src/coreclr/nativeaot/Runtime/arm64/MiscStubs.asm | Mirrors the same PacStripPtr update for Windows ARM64, using DCD 0xD50320FF for xpaclri. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
3 tasks
This was referenced Jul 10, 2026
Open
Member
Correct, no jobs reported SIGILL, EXC_BAD_INSTRUCTION, or signal 4. |
Member
|
/ba-g infrastructure timeouts |
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
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.
NativeAOT executed
xpaciduring arm64 GC stack walking, causingSIGILLon tvOS devices without pointer authentication. This ports CoreCLR’s hint-safePacStripPtrimplementation.Changes
lr.lrand executexpaclri.x0.Note
This description was generated by GitHub Copilot.