summaryrefslogtreecommitdiff
path: root/lib/tsan
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-06-05 07:29:23 +0000
committerKamil Rytarowski <n54@gmx.com>2018-06-05 07:29:23 +0000
commit7e2a55c7de9075254f44129e8da9d44107e57194 (patch)
treee194c7a40723507140e4f274f2afc31273ed57ba /lib/tsan
parent41c195d587ce74bb6a5712486434bca4fcddaaa1 (diff)
Introduce CheckASLR() in sanitizers
Summary: At least the ASan, MSan, TSan sanitizers require disabled ASLR on a NetBSD. Introduce a generic CheckASLR() routine, that implements a check for the current process. This flag depends on the global or per-process settings. There is no simple way to disable ASLR in the build process from the level of a sanitizer or during the runtime execution. With ASLR enabled sanitizers that operate over the process virtual address space can misbehave usually breaking with cryptic messages. This check is dummy for !NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D47442 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r--lib/tsan/rtl/tsan_rtl.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_rtl.cc b/lib/tsan/rtl/tsan_rtl.cc
index ee8433aba..14a3e3c43 100644
--- a/lib/tsan/rtl/tsan_rtl.cc
+++ b/lib/tsan/rtl/tsan_rtl.cc
@@ -354,6 +354,7 @@ void Initialize(ThreadState *thr) {
ctx = new(ctx_placeholder) Context;
const char *options = GetEnv(SANITIZER_GO ? "GORACE" : "TSAN_OPTIONS");
CacheBinaryName();
+ CheckASLR();
InitializeFlags(&ctx->flags, options);
AvoidCVE_2016_2143();
InitializePlatformEarly();