llvm-project/compiler-rt/lib/hwasan
Peter Collingbourne c336557f02 hwasan: Compatibility fixes for short granules.
We can't use short granules with stack instrumentation when targeting older
API levels because the rest of the system won't understand the short granule
tags stored in shadow memory.

Moreover, we need to be able to let old binaries (which won't understand
short granule tags) run on a new system that supports short granule
tags. Such binaries will call the __hwasan_tag_mismatch function when their
outlined checks fail. We can compensate for the binary's lack of support
for short granules by implementing the short granule part of the check in
the __hwasan_tag_mismatch function. Unfortunately we can't do anything about
inline checks, but I don't believe that we can generate these by default on
aarch64, nor did we do so when the ABI was fixed.

A new function, __hwasan_tag_mismatch_v2, is introduced that lets code
targeting the new runtime avoid redoing the short granule check. Because tag
mismatches are rare this isn't important from a performance perspective; the
main benefit is that it introduces a symbol dependency that prevents binaries
targeting the new runtime from running on older (i.e. incompatible) runtimes.

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

llvm-svn: 373035
2019-09-27 01:02:10 +00:00
..
.clang-format [sanitizer] Remove unneeded blank lines 2018-05-09 00:44:26 +00:00
CMakeLists.txt hwasan: Untag unwound stack frames by wrapping personality functions. 2019-08-23 01:28:44 +00:00
hwasan.cpp hwasan: Align n_namesz and n_descsz to 4 when reading notes. 2019-08-23 23:33:26 +00:00
hwasan.h hwasan: Instrument globals. 2019-08-06 22:07:29 +00:00
hwasan.syms.extra
hwasan_allocator.cpp hwasan: Improve precision of checks using short granule tags. 2019-07-09 20:22:36 +00:00
hwasan_allocator.h [sanitizer][NFC] Set LargeMmapAllocator type from PrimaryAllocator 2019-05-01 19:41:54 +00:00
hwasan_blacklist.txt
hwasan_checks.h hwasan: Improve precision of checks using short granule tags. 2019-07-09 20:22:36 +00:00
hwasan_dynamic_shadow.cpp hwasan: Rename source files from cc to cpp 2019-02-27 15:44:03 +00:00
hwasan_dynamic_shadow.h hwasan: Add __hwasan_init_static() function. 2019-01-31 23:37:12 +00:00
hwasan_exceptions.cpp hwasan: Untag unwound stack frames by wrapping personality functions. 2019-08-23 01:28:44 +00:00
hwasan_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
hwasan_flags.inc [compiler-rt] Better lint output for .inc files 2019-09-12 01:35:09 +00:00
hwasan_interceptors.cpp [HWASAN] Remove unused code 2019-05-29 10:13:41 +00:00
hwasan_interceptors_vfork.S [hwasan] Disable vfork code when building w/o interceptors. 2019-03-01 02:06:58 +00:00
hwasan_interface_internal.h hwasan: Instrument globals. 2019-08-06 22:07:29 +00:00
hwasan_linux.cpp [Sanitizer] Linux refactor shadow huge page mode handling 2019-08-05 20:54:36 +00:00
hwasan_malloc_bisect.h Runtime flags for malloc bisection. 2019-02-15 18:38:14 +00:00
hwasan_mapping.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
hwasan_memintrinsics.cpp hwasan: Rename source files from cc to cpp 2019-02-27 15:44:03 +00:00
hwasan_new_delete.cpp Remove NOLINTs from compiler-rt 2019-09-11 23:19:48 +00:00
hwasan_poisoning.cpp hwasan: Rename source files from cc to cpp 2019-02-27 15:44:03 +00:00
hwasan_poisoning.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
hwasan_report.cpp hwasan: Instrument globals. 2019-08-06 22:07:29 +00:00
hwasan_report.h hwasan: Improve precision of checks using short granule tags. 2019-07-09 20:22:36 +00:00
hwasan_tag_mismatch_aarch64.S hwasan: Compatibility fixes for short granules. 2019-09-27 01:02:10 +00:00
hwasan_thread.cpp hwasan: Use bits [3..11) of the ring buffer entry address as the base stack tag. 2019-06-17 23:39:51 +00:00
hwasan_thread.h [HWASAN] Remove unused code 2019-05-29 10:13:41 +00:00
hwasan_thread_list.cpp hwasan: Rename source files from cc to cpp 2019-02-27 15:44:03 +00:00
hwasan_thread_list.h [hwasan] Madvise away thread aux data 2019-01-25 02:05:48 +00:00