You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Pointer Authentication (PAC) for ARM64e #7
The current implementation of proxy relies on function pointers for dispatching calls to the underlying objects. On ARM64e architectures (e.g., Apple Silicon, newer ARM server chips), these indirect branches are potential targets for ROP/JOP attacks if not properly protected. Without Pointer Authentication Code (PAC) support, the library misses a critical hardware-enforced security feature available on modern platforms.
This is a security hardening feature. As proxy is designed for high-performance and system-level usage (including potential kernel design), leveraging hardware security features like PAC is essential for modern deployment environments.
If I read the docs correctly, C++ function pointers are already signed automatically if the compiler supports them.
If we want stronger guarantees:
For the function pointers, how do we derive the discriminator?
The default signing scheme uses ptrauth_key_asia + ptrauth_string_discriminator on the function pointer type. Do we want to extend it to the full mangled function name for the facade?
For the pointers to a function table, do we want to discriminate between different facades?
C++ vtables use ptrauth_key_asda + constant 0 discriminator (not discriminated) for code size and performance reasons.
also note that if you use address diversity (ptrauth_key_asd*), the pointer will no longer be trivially relocatable.
Thank you for the insights and references. I have not fully explored the PAC design space for Proxy yet, so I do not want to commit to a specific scheme prematurely. My current view is:
PAC-specific hardening is not a primary feature of the library, so any additional support should be optional and users should be able to opt out.
My understanding is that address diversity provides stronger protection than a pure discriminator, so if the platform supports it, I would want us to support an opt-in mode that can use address diversity for the vptr / function-table pointer.
If ordinary C++ function pointers are already signed automatically by the compiler when PAC is available, then the remaining question is what extra library-level controls are actually worth adding beyond that baseline.
The main trade-offs to evaluate seem to be security benefit vs. performance, code size, portability, and relocatability. I am open to further discussion and concrete design proposals here.
Activity
mochaaP commentedon Mar 11, 2026
https://clang.llvm.org/docs/PointerAuthentication.html
If I read the docs correctly, C++ function pointers are already signed automatically if the compiler supports them.
If we want stronger guarantees:
The default signing scheme uses
ptrauth_key_asia+ptrauth_string_discriminatoron the function pointer type. Do we want to extend it to the full mangled function name for the facade?C++ vtables use
ptrauth_key_asda+ constant 0 discriminator (not discriminated) for code size and performance reasons.also note that if you use address diversity (
ptrauth_key_asd*), the pointer will no longer be trivially relocatable.mingxwa commentedon Mar 13, 2026
Hi @mochaaP,
Thank you for the insights and references. I have not fully explored the PAC design space for Proxy yet, so I do not want to commit to a specific scheme prematurely. My current view is:
The main trade-offs to evaluate seem to be security benefit vs. performance, code size, portability, and relocatability. I am open to further discussion and concrete design proposals here.