diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-16 20:46:41 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-16 20:46:41 +0000 |
| commit | bb3e32a16c3cb9346be69c3a0719960020f8b6a3 (patch) | |
| tree | 7aef5788f4da973f94f02793c49754abc485adeb /include | |
| parent | b494215c450ebeb892df83b979ae3b7f01c15288 (diff) | |
| download | compiler-rt-bb3e32a16c3cb9346be69c3a0719960020f8b6a3.tar.gz | |
[hwasan] Add __hwasan_handle_longjmp.
Summary:
A callback to annotate longjmp-like code.
Unlike __asan_handle_no_return, in hwasan we can not conservatively
"unpoison" the entire thread stack, because there is no such thing as
unpoisoned memory. Pointer and memory tags must always match.
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50752
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@339935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/sanitizer/hwasan_interface.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sanitizer/hwasan_interface.h b/include/sanitizer/hwasan_interface.h index 9ca73bc10..78644aa9d 100644 --- a/include/sanitizer/hwasan_interface.h +++ b/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); |
