llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[libunwind][AArch64] Protect PC within libunwind's context.

Open DanielKristofKiss opened this issue 4 months ago • 2 comments

Libunwind manages the registers/context including the program counter which is used effectively as a return address. __libunwind_Registers_arm64_jumpto can go anywhere where the given buffer 's PC points to. To increase the robustness of libunwind let's protect the stored address with PAC. Let's use the A key and the base address of the context/registers as modifier. After this patch the PC must be signed therefore the context harder to craft outside of libunwind.

The register set is internal to libunwind and this change is not visible on the APIs.

DanielKristofKiss avatar Oct 22 '24 19:10 DanielKristofKiss