1. [compiler-rt] Expose __hwasan_tag_mismatch_stub (details)
Commit 6d11abfe3507ec6d8bdac4c79ef7249abd3fdc07 by david.tellenbach
[compiler-rt] Expose __hwasan_tag_mismatch_stub
Summary: GCC would like to emit a function call to report a tag mismatch
rather than hard-code the `brk` instruction directly.
__hwasan_tag_mismatch_stub contains most of the functionality to do this
already, but requires exposure in the dynamic library.
This patch moves __hwasan_tag_mismatch_stub outside of the anonymous
namespace that it was defined in and declares it in
We also add the ability to pass sizes larger than 16 bytes to this
reporting function by providing a fourth parameter that is only looked
at when the size provided is not in the original accepted range.
This does not change the behaviour where it is already being called,
since the previous definition only accepted sizes up to 16 bytes and
hence the change in behaviour is not seen by existing users. The change
in declaration does not matter, since the only existing use is in the
__hwasan_tag_mismatch function written in assembly.
Reviewers: eugenis, kcc, pcc, #sanitizers
Reviewed By: eugenis, #sanitizers
Subscribers: kristof.beyls, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision:
Patch by Matthew Malcomson <>
The file was modifiedcompiler-rt/lib/hwasan/hwasan_linux.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan_tag_mismatch_aarch64.S
The file was modifiedcompiler-rt/lib/hwasan/hwasan_interface_internal.h