summaryrefslogtreecommitdiff
path: root/lib/asan/asan_interceptors.h
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-05-04 14:03:57 +0000
committerPeter Wu <peter@lekensteyn.nl>2017-05-04 14:03:57 +0000
commitdaf4d1dbabac3085ea44745f44decc99449e5771 (patch)
tree8ff875318833eee220d6c190cdfe15ddd0992f97 /lib/asan/asan_interceptors.h
parent6bae4bb552040cae850681707c0c2f8d65a0b023 (diff)
[ASAN] Add interceptor for __longjmp_chk
Summary: glibc on Linux calls __longjmp_chk instead of longjmp (or _longjmp) when _FORTIFY_SOURCE is defined. Ensure that an ASAN-instrumented program intercepts this function when a system library calls it, otherwise the stack might remain poisoned and result in CHECK failures and false positives. Fixes https://github.com/google/sanitizers/issues/721 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D32408 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_interceptors.h')
-rw-r--r--lib/asan/asan_interceptors.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/asan/asan_interceptors.h b/lib/asan/asan_interceptors.h
index d747c31a5..93fca4f67 100644
--- a/lib/asan/asan_interceptors.h
+++ b/lib/asan/asan_interceptors.h
@@ -58,6 +58,12 @@
# define ASAN_INTERCEPT_SIGLONGJMP 0
#endif
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
+# define ASAN_INTERCEPT___LONGJMP_CHK 1
+#else
+# define ASAN_INTERCEPT___LONGJMP_CHK 0
+#endif
+
// Android bug: https://code.google.com/p/android/issues/detail?id=61799
#if ASAN_HAS_EXCEPTIONS && !SANITIZER_WINDOWS && \
!(SANITIZER_ANDROID && defined(__i386))