diff options
author | Francis Ricci <francisjricci@gmail.com> | 2017-04-17 16:34:38 +0000 |
---|---|---|
committer | Francis Ricci <francisjricci@gmail.com> | 2017-04-17 16:34:38 +0000 |
commit | 9e60082e3f68e8619ffc917bbdaaf0636c3fcaa3 (patch) | |
tree | c3c68e1b770333cbc41e459be9595215d2b9c2dd /lib/sanitizer_common/sanitizer_common.h | |
parent | 1bc70377e9230a971ce88ee7270a705ce306d103 (diff) |
Don't read non-readable address ranges during lsan pointer scanning
Summary: This specifically addresses the Mach-O zero page, which we cannot read from.
Reviewers: kubamracek, samsonov, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32044
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.h b/lib/sanitizer_common/sanitizer_common.h index 9d367ca80..313f0cfda 100644 --- a/lib/sanitizer_common/sanitizer_common.h +++ b/lib/sanitizer_common/sanitizer_common.h @@ -717,7 +717,7 @@ class LoadedModule { void set(const char *module_name, uptr base_address, ModuleArch arch, u8 uuid[kModuleUUIDSize], bool instrumented); void clear(); - void addAddressRange(uptr beg, uptr end, bool executable); + void addAddressRange(uptr beg, uptr end, bool executable, bool readable); bool containsAddress(uptr address) const; const char *full_name() const { return full_name_; } @@ -732,9 +732,14 @@ class LoadedModule { uptr beg; uptr end; bool executable; - - AddressRange(uptr beg, uptr end, bool executable) - : next(nullptr), beg(beg), end(end), executable(executable) {} + bool readable; + + AddressRange(uptr beg, uptr end, bool executable, bool readable) + : next(nullptr), + beg(beg), + end(end), + executable(executable), + readable(readable) {} }; const IntrusiveList<AddressRange> &ranges() const { return ranges_; } |