diff options
author | Peter Collingbourne <pcc@google.com> | 2021-04-06 23:02:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-04-06 23:02:29 +0000 |
commit | 2b9719e3612149aa0a2124e135bc8ed2d5b911dd (patch) | |
tree | 9402bf2f36482396b2ee0a1548c9b1d589658b91 /libc | |
parent | e71143e8c0016137a5fe005d7c39fbb03922f1f4 (diff) | |
parent | 811d180e892f757d052cf9d6c6b7494a8c4a8c2f (diff) |
Merge "Reset PAC keys on thread creation instead of on zygote fork."
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/pthread_create.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp index 206d5fdeb..f3fee8805 100644 --- a/libc/bionic/pthread_create.cpp +++ b/libc/bionic/pthread_create.cpp @@ -344,6 +344,12 @@ static int __pthread_start(void* arg) { __set_stack_and_tls_vma_name(false); __init_additional_stacks(thread); __rt_sigprocmask(SIG_SETMASK, &thread->start_mask, nullptr, sizeof(thread->start_mask)); +#ifdef __aarch64__ + // Chrome's sandbox prevents this prctl, so only reset IA if the target SDK level is high enough. + if (android_get_application_target_sdk_version() >= __ANDROID_API_S__) { + prctl(PR_PAC_RESET_KEYS, PR_PAC_APIAKEY, 0, 0, 0); + } +#endif void* result = thread->start_routine(thread->start_routine_arg); pthread_exit(result); |