rust-lang / rust-lang/rust

Add support for AArch64 Pointer Authentication ABI in Rust

Open
#148,640 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-ABI C-feature-request O-AArch64 T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Recently there were efforts in LLVM mainline intended for:

As a result, LLVM 21 has more or less complete support for pointer authentication features for ELF targets (MachoO bits are still not there, so there is no full arm64e ABI support).

This is a tracking issue to add support for pointer authentication to Rust basing on the existing LLVM support.

Overall, everything could be split into 3 subtasks:

  • Add support for extern "C" function pointers. This invokes both calling them via signed function pointers from Rust case as well as providing properly authenticated extern "C" Rust functions to be called from pauth-enabled C code. We'd need to support type-discriminated function pointers here as well, so few bits of signing scheme should be either reimplemented in rustc or imported from elsewhere (e.g. clang). The support should be based on Linux pauthtest ABI and could be further adopted by interested platforms. Overall the pauth itself support seems to be simple, it is just some boilerplate glue code that requires to be written.
  • Same as above but for C++ functions. This might be much more elaborated as C++ pointer authentication ABI relies on many implementations details (and could be dependent on the chosen signing scheme)
  • Develop pointer authentication ABI for Rust code. This would require development of Rust Pointer Authentication ABI and certainly would require an RFC.

I want to explicitly mention that the primary target would be ELF-based platforms. There is no intention to support arm64e (so this issue is a bit orthogonal to https://github.com/rust-lang/rust/issues/73628) simply because there is no full LLVM mainline support for this ABI at the time of writing. Still, I'd anticipate that implementing the pauth for ELF platforms would allow straightforward implementation of arm64e ABI if / when LLVM mainline would support it – likely some lightweight plumbing of settings and options.

References:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the LLVM 21 ELF pointer-authentication support, the ARM pauthabielf64 specification, and Clang's Pointer Authentication documentation. A complete resolution would need to scope and implement the extern "C" function-pointer ABI, evaluate C++ support, and define the Rust ABI, including any required RFC.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.