From 7d260775f34f215b873f8b6c0528d0edc8d3ea0a Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Tue, 5 Jun 2018 07:29:23 +0000 Subject: 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 Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D47442 llvm-svn: 333985 --- compiler-rt/lib/asan/asan_rtl.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler-rt/lib/asan/asan_rtl.cc') diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 5a28e775228..15b5035e648 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -384,6 +384,7 @@ static void AsanInitInternal() { asan_init_is_running = true; CacheBinaryName(); + CheckASLR(); // Initialize flags. This must be done early, because most of the // initialization steps look at flags(). -- cgit v1.2.3