diff options
author | Peter Collingbourne <pcc@google.com> | 2021-06-04 14:35:13 -0700 |
---|---|---|
committer | Peter Collingbourne <pcc@google.com> | 2021-06-08 18:41:36 -0700 |
commit | 9a1b7d124353afd76447ea2a9dea1903cc10b335 (patch) | |
tree | a2f0eb27c3a9a218aed1f18291ecc310ea063a5b /libc | |
parent | a3b1926d75c2e46083429ae1e952035480dc3221 (diff) |
Disable return PAC in __pthread_start.
This function doesn't return, but it does appear in stack traces. Avoid
using return PAC in this function because we may end up resetting IA,
which may confuse unwinders due to mismatching keys.
Bug: 189808795
Change-Id: I953da9078acd1d43eb7a47fb11f75caa0099fa12
Merged-In: I953da9078acd1d43eb7a47fb11f75caa0099fa12
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/pthread_create.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp index 46d9e8672..121b26f82 100644 --- a/libc/bionic/pthread_create.cpp +++ b/libc/bionic/pthread_create.cpp @@ -331,6 +331,11 @@ void __set_stack_and_tls_vma_name(bool is_main_thread) { extern "C" int __rt_sigprocmask(int, const sigset64_t*, sigset64_t*, size_t); __attribute__((no_sanitize("hwaddress"))) +#ifdef __aarch64__ +// This function doesn't return, but it does appear in stack traces. Avoid using return PAC in this +// function because we may end up resetting IA, which may confuse unwinders due to mismatching keys. +__attribute__((target("branch-protection=bti"))) +#endif static int __pthread_start(void* arg) { pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(arg); |