summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-06-09 16:14:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-06-09 16:14:18 +0000
commiteb5f5d8db6fcbda80ea3938627bcb1e8cc95666a (patch)
treecdd69b84cc2f793888992f8fb76440dc2db17c72 /libc
parent381ed8f9d2d247a760d7348d928bef8ac534886c (diff)
parent9a1b7d124353afd76447ea2a9dea1903cc10b335 (diff)
Merge "Disable return PAC in __pthread_start." into sc-dev
Diffstat (limited to 'libc')
-rw-r--r--libc/bionic/pthread_create.cpp5
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);