forked from OSchip/llvm-project
[TSan] Support pointer authentication in setjmp/longjmp interceptors
arm64e adds support for pointer authentication, which was adopted by libplatform to harden setjmp/longjmp and friends. We need to teach the TSan interceptors for those functions about this. Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D76257
This commit is contained in:
parent
e009fad342
commit
f8e8f0a603
|
@ -41,6 +41,10 @@
|
|||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
|
||||
#if __has_feature(ptrauth_calls)
|
||||
#include <ptrauth.h>
|
||||
#endif
|
||||
|
||||
namespace __tsan {
|
||||
|
||||
#if !SANITIZER_GO
|
||||
|
@ -274,6 +278,10 @@ void InitializePlatform() {
|
|||
uptr ExtractLongJmpSp(uptr *env) {
|
||||
uptr mangled_sp = env[LONG_JMP_SP_ENV_SLOT];
|
||||
uptr sp = mangled_sp ^ longjmp_xor_key;
|
||||
#if __has_feature(ptrauth_calls)
|
||||
sp = (uptr)ptrauth_auth_data((void *)sp, ptrauth_key_asdb,
|
||||
ptrauth_string_discriminator("sp"));
|
||||
#endif
|
||||
return sp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue