Skip to content

[AArch64] Add initial support for PAC relocs#2

Closed
kovdan01 wants to merge 16 commits intomaster-oldfrom
dkovalev/pauth-release-19.x
Closed

[AArch64] Add initial support for PAC relocs#2
kovdan01 wants to merge 16 commits intomaster-oldfrom
dkovalev/pauth-release-19.x

Conversation

@kovdan01
Copy link

@kovdan01 kovdan01 commented Aug 23, 2024

This replaces #1 with some enhancements:

  • support for signed GOT and PLT GOT;
  • support for addr discr of init/fini pointers;
  • support for R_AARCH64_AUTH_TLSDESC reloc.

eleviant and others added 10 commits September 5, 2023 13:29
TODO: do we need this to be done for vDSO as well?
- Do not check pointer signature before we are relocated
  as this might be a pointer to global.
- Sign function pointers returned from __vdsosym.
- Do not apply PAC relocs in __dls2, because we may need
  to do this second time in __dls3. We can't do this as
  we overwrite authentication scheme when applying relocs.
@kovdan01 kovdan01 force-pushed the dkovalev/pauth-release-19.x branch from 1268c66 to 9525be8 Compare September 12, 2024 16:29
kovdan01 and others added 2 commits March 25, 2025 20:13
…resent

Previously, it was signed unconditionally w/o taking the dynamic tag into
account (only `__has_feature(ptrauth_calls)` was checked by preprocessor).

See also specification:
https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#recording-a-signed-plt-got-in-the-elf-file
Ideally, this should be conditional on whether ptrauth_returns is
requested and which key is used, but this patch still should be safe as
PACIASP and AUTIASP are encoded as HINT and both prologue and epilogue
use the same IA key.

Note that even if .init_array and .fini_array are actually used,
_init and _fini functions are statically linked into every executable,
thus this patch is a natural way to silence multiple warnings reported
by PAuth gadget scanner for every executable.
@kovdan01 kovdan01 changed the base branch from master to master-old July 28, 2025 16:56
@kovdan01
Copy link
Author

Closing this as it's superseeded by #5 which is based on top of latest v1.2.5 musl release.

@kovdan01 kovdan01 closed this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants