diff options
author | Kamil Rytarowski <n54@gmx.com> | 2018-06-05 07:29:23 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2018-06-05 07:29:23 +0000 |
commit | 7e2a55c7de9075254f44129e8da9d44107e57194 (patch) | |
tree | e194c7a40723507140e4f274f2afc31273ed57ba /lib/asan/asan_rtl.cc | |
parent | 41c195d587ce74bb6a5712486434bca4fcddaaa1 (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/asan/asan_rtl.cc')
-rw-r--r-- | lib/asan/asan_rtl.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index 5a28e7752..15b5035e6 100644 --- a/lib/asan/asan_rtl.cc +++ b/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(). |