libc: Add Armv8.3-A PAuth and Armv8.5-A BTI compatibility to *.S
The most notable change is in sigsetjmp/siglongjmp. The former
stores LR signed with the current SP into jmp_buf. Calling siglongjmp
reads a signed LR and the corresponding SP from jmp_buf. This way not
only the checksum provides some means of integrity protection but
Pointer Authentication too.
Test: Tested on FVP with BTI enabled.
Change-Id: I9d720239775f8d2829a677901f546c4b14b5cbe5
diff --git a/libc/arch-arm64/bionic/vfork.S b/libc/arch-arm64/bionic/vfork.S
index 5cfb8b0..81b84a3 100644
--- a/libc/arch-arm64/bionic/vfork.S
+++ b/libc/arch-arm64/bionic/vfork.S
@@ -67,6 +67,8 @@
// Clean up stack shadow in the parent process.
// https://github.com/google/sanitizers/issues/925
+ hint #25 // paciasp
+ .cfi_negate_ra_state
stp x0, x30, [sp, #-16]!
.cfi_adjust_cfa_offset 16
.cfi_rel_offset x0, 0
@@ -79,9 +81,13 @@
.cfi_adjust_cfa_offset -16
.cfi_restore x0
.cfi_restore x30
+ hint #29 // autiasp
+ .cfi_negate_ra_state
#endif
.L_exit:
ret
END(vfork)
+
+NOTE_GNU_PROPERTY()