Uh oh!
There was an error while loading. Please reload this page.
Use hint-safe pointer authentication stripping in NativeAOT - #130474
Conversation
Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
kotlarmilos
commented
Jul 10, 2026
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jkotas
commented
Jul 10, 2026
SwapnilGaikwad
commented
Jul 10, 2026
The fix LGTM! |
SwapnilGaikwad
commented
Jul 10, 2026
Failure seem unrelated, no SIGILL or Illegal Instruction failures. |
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
kotlarmilos
commented
Jul 10, 2026
Correct, no jobs reported SIGILL, EXC_BAD_INSTRUCTION, or signal 4. |
jkotas
commented
Jul 10, 2026
/ba-g infrastructure timeouts |
Uh oh!
There was an error while loading. Please reload this page.
<!-- --> NativeAOT executed `xpaci` during arm64 GC stack walking, causing `SIGILL` on tvOS devices without pointer authentication. This ports CoreCLR’s hint-safe `PacStripPtr` implementation. ## Changes - Preserve the caller’s `lr`. - Move the pointer through `lr` and execute `xpaclri`. - Return the stripped pointer through `x0`. - Apply the change to Unix and Windows arm64 assembly stubs. ```asm mov lr, x0 xpaclri mov x0, lr ``` > [!NOTE] > This description was generated by GitHub Copilot. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
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.