summaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-01-04 23:24:02 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-01-04 23:24:02 +0000
commitcf642eceb8e344eac55fe868aa6762bd906bbef0 (patch)
tree2024d2ac21c1f0ef8cfebce664448fac3b02896f /compiler-rt
parent1f9c8e097f2c85c6c13a8358277b99d6c0dcfee2 (diff)
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.
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/hwasan/hwasan_interceptors.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cc b/compiler-rt/lib/hwasan/hwasan_interceptors.cc
index edb19a56113..fb0dcb8905c 100644
--- a/compiler-rt/lib/hwasan/hwasan_interceptors.cc
+++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cc
@@ -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