diff options
| author | 2020-05-16 01:37:26 +0100 | |
|---|---|---|
| committer | 2020-05-18 09:27:28 +0000 | |
| commit | 88c139b92f155deeb9997e02f720b9ac0042b806 (patch) | |
| tree | 983f600b2fb110ca20445f2f651b8dd1a8aeccc9 | |
| parent | 1439e573517bb9f0b115aef5d3bbd9090751ebd6 (diff) | |
Disable hwasan for BitMemoryRegion::LoadBits
It uses different attribute compared to the standard asan.
Bug: 156593692
Test: SANITIZE_TARGET=hwaddress art/tools/run-gtests.sh
Change-Id: I3be85273ee19778751d2bd638f2ee2c32442f0e5
| -rw-r--r-- | libartbase/base/bit_memory_region.h | 1 | ||||
| -rw-r--r-- | libartbase/base/memory_tool.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libartbase/base/bit_memory_region.h b/libartbase/base/bit_memory_region.h index e98da24492..5d54445bff 100644 --- a/libartbase/base/bit_memory_region.h +++ b/libartbase/base/bit_memory_region.h @@ -105,6 +105,7 @@ class BitMemoryRegion final : public ValueObject { // The least significant bit is stored in the smallest memory offset. template<typename Result = size_t> ATTRIBUTE_NO_SANITIZE_ADDRESS // We might touch extra bytes due to the alignment. + ATTRIBUTE_NO_SANITIZE_HWADDRESS // The hwasan uses different attribute. ALWAYS_INLINE Result LoadBits(size_t bit_offset, size_t bit_length) const { static_assert(std::is_integral<Result>::value, "Result must be integral"); static_assert(std::is_unsigned<Result>::value, "Result must be unsigned"); diff --git a/libartbase/base/memory_tool.h b/libartbase/base/memory_tool.h index 1a6a9bb58e..aca12015c3 100644 --- a/libartbase/base/memory_tool.h +++ b/libartbase/base/memory_tool.h @@ -66,6 +66,12 @@ constexpr size_t kMemoryToolStackGuardSizeScale = 1; #endif +#if __has_feature(hwaddress_sanitizer) +# define ATTRIBUTE_NO_SANITIZE_HWADDRESS __attribute__((no_sanitize("hwaddress"))) +#else +# define ATTRIBUTE_NO_SANITIZE_HWADDRESS +#endif + } // namespace art #endif // ART_LIBARTBASE_BASE_MEMORY_TOOL_H_ |