Skip to content

Commit 88b5127

Browse files
xpaclri drops the top byte of the pointer if TBI is not configured,
which will make a difference in the check when PAC is disabled as auth will keep the top byte.
1 parent 9ff7d83 commit 88b5127

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

libunwind/src/Registers.hpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,29 +1836,13 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
18361836
// Authenticate the given pointer and return with the raw value
18371837
// if the authentication is succeeded.
18381838
inline uint64_t auth(uint64_t ptr, uint64_t salt) const {
1839-
uint64_t ret;
18401839
register uint64_t x17 __asm("x17") = ptr;
18411840
register uint64_t x16 __asm("x16") = salt;
18421841
asm volatile("hint 0xc" // autia1716
18431842
: "+r"(x17)
18441843
: "r"(x16)
18451844
:);
1846-
ret = x17;
1847-
uint64_t checkValue = ptr;
1848-
// Support for machines without FPAC.
1849-
// Strip the upper bits with `XPACLRI` and compare with the
1850-
// authenticated value.
1851-
asm volatile("mov x30, %[checkValue] \r\n" \
1852-
"hint 0x7 \r\n" \
1853-
"mov %[checkValue], x30 \r\n" \
1854-
: [checkValue] "+r"(checkValue)
1855-
:
1856-
: "x30");
1857-
if (x17 != checkValue) {
1858-
_LIBUNWIND_LOG("x17 %llx, strip %llx, ptr %llx", x17, checkValue, ptr);
1859-
_LIBUNWIND_ABORT("IP PAC authentication failure");
1860-
}
1861-
return ret;
1845+
return x17;
18621846
}
18631847

18641848
// Sign the PC with the A-KEY and the current salt.

0 commit comments

Comments
 (0)