Adding Pointer-Authentication Protection For Free List Forward Edge#840
Adding Pointer-Authentication Protection For Free List Forward Edge#840Pengxiang-Huang wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Co-authored-by: Schrodinger ZHU Yifan <i@zhuyi.fan>
|
@microsoft-github-policy-service agree |
|
I think we can just I remember being told inside llvm-libc that PAC hints are no-op on arch without support. So it might also be okay to have it on aarch64 as long as user enable the mitigation. I don't have time to exactly verify this. The following materials are summarized by Codex with ChatGPT 5.4 (high):
|
There was a problem hiding this comment.
Pull request overview
This PR adds Pointer Authentication Code (PAC) support for forward-edge protection of freelist “next” pointers on AArch64, integrating it into snmalloc’s AAL feature system and wiring up CMake detection/flags.
Changes:
- Introduces a new
PtrAuthenticationAAL feature and generic AAL helpers for signing/authenticating stored pointers. - Implements ARM AAL support using
ptrauth.h(when available) and applies PAC to freelist forward-edge encoding/decoding. - Extends CMake configuration to probe for PAC support and define/enable the feature.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Detects PAC support and adds build flags / defines to enable the feature. |
| src/snmalloc/aal/aal.h | Adds generic AAL wrappers for pointer sign/auth operations. |
| src/snmalloc/aal/aal_consts.h | Adds PtrAuthentication to the AalFeatures enum. |
| src/snmalloc/aal/aal_arm.h | Implements ARM PAC sign/auth via ptrauth.h under feature guards. |
| src/snmalloc/mem/freelist.h | Uses PAC for freelist forward-edge protection when supported, else falls back to existing schemes. |
Co-authored-by: Schrodinger ZHU Yifan i@zhuyi.fan
The implementation is largely based on the original code proposed in this issue: #838 @SchrodingerZhu
I did some correctness changes for the cmake; some minor fixes; and adding a few comments;
I run and verify this PAC feature on my local Mac environment with Apple Clang 17.