llvm / llvm/llvm-project

[BOLT][PAC] Improve gadget scanner documentation on explicit pointer checks

Open
#186,202 3 comments 1 reaction 0 assignees View on GitHub
BOLT
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

In the AArch64 backend, it is common to insert explicit pointer checks after authentication in some cases, unless the target CPU is known to implement `FEAT_FPAC` (which is an extension that modifies the behavior of authentication instructions so that they raise an error on authentication failure instead of just making their result non-canonical virtual address).

In #176446 I tried to describe the particular outcomes of **not** checking the result of authentication explicitly in instruction sequences along these lines:
```
autda x0, x1
// x0 may hold the result of the failed authentication at this point
// unless FEAT_FPAC is implemented
pacda x0, x2
```

It turned out not to be as trivial as I expected: at first glance no combination of architectural extensions (`FEAT_EPAC`, `FEAT_PAuth2`) result in obviously unsafe behavior.

As #176446 contains many other additions to the documentation, I would rather reduce the discussion of the differences between plain authenticated pointers vs. authenticated-and-checked ones to the bare minimum in that particular PR and open a separate issue (this one) as the reminder to finalize that discussion via a separate follow-up PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.