summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
diff options
context:
space:
mode:
authorDerek Bruening <bruening@google.com>2016-06-14 15:15:38 +0000
committerDerek Bruening <bruening@google.com>2016-06-14 15:15:38 +0000
commitf6f149da29d9d4553901f4d24201d125cabfd4e9 (patch)
tree544c1b03be046ec58d2edc30dcebd57a92cb407e /compiler-rt/lib/sanitizer_common/sanitizer_linux.h
parent5e6298b0f2b06c1b8c9713d2044576558e3186cb (diff)
downloadbcm5719-llvm-f6f149da29d9d4553901f4d24201d125cabfd4e9.tar.gz
bcm5719-llvm-f6f149da29d9d4553901f4d24201d125cabfd4e9.zip
[sanitizer][esan] Add internal_sigaction_syscall
Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 llvm-svn: 272676
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_linux.h')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_linux.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
index beb43568ad0..526fa4426e3 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
@@ -42,6 +42,10 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
// (like the process-wide error reporting SEGV handler) must use
// internal_sigaction instead.
int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
+#if defined(__x86_64__) && !SANITIZER_GO
+// Uses a raw system call to avoid interceptors.
+int internal_sigaction_syscall(int signum, const void *act, void *oldact);
+#endif
void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
#if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) \
|| defined(__powerpc64__) || defined(__s390__)
OpenPOWER on IntegriCloud