Bring back the pthread_create interceptor, but only on non-aarch64.

We still need the interceptor on non-aarch64 to untag the pthread_t
and pthread_attr_t pointers and disable tagging on allocations done
internally by glibc.

llvm-svn: 350445
This commit is contained in:
Peter Collingbourne 2019-01-04 23:24:02 +00:00
parent 714e170648
commit 1c650debd7
1 changed files with 14 additions and 0 deletions

View File

@ -217,6 +217,17 @@ INTERCEPTOR_ALIAS(void, malloc_stats, void);
#endif
#endif // HWASAN_WITH_INTERCEPTORS
#if HWASAN_WITH_INTERCEPTORS && !defined(__aarch64__)
INTERCEPTOR(int, pthread_create, void *th, void *attr,
void *(*callback)(void *), void *param) {
ScopedTaggingDisabler disabler;
int res = REAL(pthread_create)(UntagPtr(th), UntagPtr(attr),
callback, param);
return res;
}
#endif
static void BeforeFork() {
StackDepotLockAll();
}
@ -256,6 +267,9 @@ void InitializeInterceptors() {
INTERCEPT_FUNCTION(fork);
#if HWASAN_WITH_INTERCEPTORS
#if !defined(__aarch64__)
INTERCEPT_FUNCTION(pthread_create);
#endif
INTERCEPT_FUNCTION(realloc);
INTERCEPT_FUNCTION(free);
#endif