diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-05-24 02:47:59 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-05-24 02:47:59 +0000 |
commit | 5236cff8bf581bb2615c787eb59ed53d0cb95586 (patch) | |
tree | f5d3f2bff7bad83103298dc5a47fd3a57ba798e8 /lib/msan/msan.cc | |
parent | 1cc9bbb81c4e4eb09444cd233cb622e180b6cadc (diff) |
[msan] Mprotect all inaccessible memory regions.
Fix 2 bugs in memory mapping setup:
- the invalid region at offset 0 was not protected because mmap at
address 0 fails with EPERM on most Linux systems. We did not
notice this because the check condition was flipped: the code was
checking that mprotect has failed. And the test that was supposed
to catch this was weakened by the mitigations in the mmap
interceptor.
- when running without origins, the origin shadow range was left
unprotected.
The new test ensures that mmap w/o MAP_FIXED always returns valid
application addresses.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@238109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan.cc')
-rw-r--r-- | lib/msan/msan.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/msan/msan.cc b/lib/msan/msan.cc index 8f741de11..dd72c9da6 100644 --- a/lib/msan/msan.cc +++ b/lib/msan/msan.cc @@ -390,7 +390,7 @@ void __msan_init() { __msan_clear_on_return(); if (__msan_get_track_origins()) VPrintf(1, "msan_track_origins\n"); - if (!InitShadow(/* map_shadow */ true, __msan_get_track_origins())) { + if (!InitShadow(__msan_get_track_origins())) { Printf("FATAL: MemorySanitizer can not mmap the shadow memory.\n"); Printf("FATAL: Make sure to compile with -fPIE and to link with -pie.\n"); Printf("FATAL: Disabling ASLR is known to cause this error.\n"); |