summaryrefslogtreecommitdiff
path: root/lib/esan/esan.cpp
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
commitb90f32bd596ec6e4c29d1e22bf83da6b2539d132 (patch)
treefa740508825a7aaf127adc09985d3f927e33a70f /lib/esan/esan.cpp
parentdf01596dcf605330585d5d539914aa9e25e45bb2 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/esan/esan.cpp')
-rw-r--r--lib/esan/esan.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/esan/esan.cpp b/lib/esan/esan.cpp
index e7399e219..e6d6aff31 100644
--- a/lib/esan/esan.cpp
+++ b/lib/esan/esan.cpp
@@ -197,6 +197,9 @@ void initializeLibrary(ToolType Tool) {
}
initializeShadow();
+ if (__esan_which_tool == ESAN_WorkingSet)
+ initializeShadowWorkingSet();
+
initializeInterceptors();
if (__esan_which_tool == ESAN_CacheFrag) {