diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-16 23:17:14 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-16 23:17:14 +0000 |
commit | 37fb896572b7462c0e594ba43ff9aa5d7c83c05c (patch) | |
tree | dfe2115c459131f65d3686250c2a38b21d4657bf /compiler-rt/include | |
parent | 75ca6be1c11c8084e86a2f44d150699fc9965363 (diff) | |
download | bcm5719-llvm-37fb896572b7462c0e594ba43ff9aa5d7c83c05c.tar.gz bcm5719-llvm-37fb896572b7462c0e594ba43ff9aa5d7c83c05c.zip |
Revert "Revert "[hwasan] Add __hwasan_handle_longjmp.""
This reapplies commit r339935 with the following changes:
* make longjmp test C, not C++, to avoid dependency on libc++/libstdc++
* untag pointer in memset interceptor
x86_64 does not have TBI, so hwasan barely works there. Tests must be carefully
written in a way that does not leak tagged pointer to system libraries.
llvm-svn: 339963
Diffstat (limited to 'compiler-rt/include')
-rw-r--r-- | compiler-rt/include/sanitizer/hwasan_interface.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h b/compiler-rt/include/sanitizer/hwasan_interface.h index 9ca73bc1072..78644aa9d4f 100644 --- a/compiler-rt/include/sanitizer/hwasan_interface.h +++ b/compiler-rt/include/sanitizer/hwasan_interface.h @@ -40,6 +40,13 @@ extern "C" { /// Set pointer tag. Previous tag is lost. void *__hwasan_tag_pointer(const volatile void *p, unsigned char tag); + // Set memory tag from the current SP address to the given address to zero. + // This is meant to annotate longjmp and other non-local jumps. + // This function needs to know the (almost) exact destination frame address; + // clearing shadow for the entire thread stack like __asan_handle_no_return + // does would cause false reports. + void __hwasan_handle_longjmp(const void *sp_dst); + // Print shadow and origin for the memory range to stderr in a human-readable // format. void __hwasan_print_shadow(const volatile void *x, size_t size); |