Skip to content

[WIP] Introduce aarch64-unknown-linux-pauthtest target#154759

Closed
jchlanda wants to merge 10 commits into
rust-lang:mainfrom
jchlanda:jakub/pauthtest
Closed

[WIP] Introduce aarch64-unknown-linux-pauthtest target#154759
jchlanda wants to merge 10 commits into
rust-lang:mainfrom
jchlanda:jakub/pauthtest

Conversation

@jchlanda

@jchlanda jchlanda commented Apr 3, 2026

Copy link
Copy Markdown

View all comments

The target enables Pointer Authentication Code (PAC) support in Rust on AArch64
ELF based Linux systems using a pauthtest ABI (provided by LLVM) and
pauthtest-enabled sysroot with custom musl, serving as a reference libc
implementation. It requires dynamic linking with a pauthtest-enabled dynamic
linker serving as ELF interpreter capable of resolving pauth relocations and
respecting pauthtest ABI constraints.

Supported features include:

  • authenticating signed function pointers for extern "C" function calls
    (corresponds to -fptrauth-calls included in pauthtest ABI as defined in
    LLVM)
  • signing return address before spilling to stack and authenticating return
    address after restoring from stack for non-leaf functions (corresponds to
    -fptrauth-returns)
  • trapping if authentication failure is detected and FPAC feature is not present
    (corresponds to -fptrauth-auth-traps)
  • signing of init/fini array entries with the signing schema used for pauthtest
    ABI (corresponding to -fptrauth-init-fini,
    -fptrauth-init-fini-address-discrimination)
  • non-ABI-affecting indirect control flow hardening features included in
    pauthtest ABI (corresponding to -faarch64-jump-table-hardening,
    -fptrauth-indirect-gotos)
  • signed ELF GOT entries (gated behind -Z ptrauth-elf-got, off by default)

Existing compiler support, such as enabling branch authentication instructions
(i.e.: -Z branch-protection) provide limited functionality, mainly signing
return addresses (pac-ret). The new target goes further by enabling ABI-level
pointer authentication support.

Please note that efforts were made to split the work into individual commits
that encapsulate different areas of the code; however, the commits are not
atomic and cannot be built or tested in isolation.

Useful links:

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants