[HWASan] Introduce non-zero based and dynamic shadow memory (compiler-rt).
authorAlex Shlyapnikov <alekseys@google.com>
Fri, 20 Apr 2018 20:03:57 +0000 (20:03 +0000)
committerAlex Shlyapnikov <alekseys@google.com>
Fri, 20 Apr 2018 20:03:57 +0000 (20:03 +0000)
commitc3ec1643f186e6c2a3ae20bc9d9d01858a857152
treec4072d144aefece49b3d569727d9704702ab375a
parent18f17333ddb1d371cc4810cd16fa24040095ddc3
[HWASan] Introduce non-zero based and dynamic shadow memory (compiler-rt).

Summary:
Retire the fixed shadow memory mapping to avoid conflicts with default
process memory mapping (currently manifests on Android).

Tests on AArch64 show <1% performance loss and code size increase,
making it possible to use dynamic shadow memory by default.

For the simplicity and unifirmity sake, use dynamic shadow memory mapping
with base address accessed via ifunc resolver on all supported platforms.

Keep the fixed shadow memory mapping around to be able to run
performance comparison tests later.

Complementing D45840.

Reviewers: eugenis

Subscribers: srhines, kubamracek, dberris, mgorny, kristof.beyls, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D45847

llvm-svn: 330474
13 files changed:
compiler-rt/lib/hwasan/CMakeLists.txt
compiler-rt/lib/hwasan/hwasan.cc
compiler-rt/lib/hwasan/hwasan.h
compiler-rt/lib/hwasan/hwasan_allocator.cc
compiler-rt/lib/hwasan/hwasan_dynamic_shadow.cc [new file with mode: 0644]
compiler-rt/lib/hwasan/hwasan_dynamic_shadow.h [new file with mode: 0644]
compiler-rt/lib/hwasan/hwasan_interceptors.cc
compiler-rt/lib/hwasan/hwasan_interface_internal.h
compiler-rt/lib/hwasan/hwasan_linux.cc
compiler-rt/lib/hwasan/hwasan_mapping.h [new file with mode: 0644]
compiler-rt/lib/hwasan/hwasan_poisoning.cc
compiler-rt/lib/hwasan/hwasan_report.cc
compiler-rt/lib/hwasan/hwasan_thread.cc