[PATCH] D111842: [scudo] Fix running tests under hwasan.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 14:32:09 PDT 2021


eugenis created this revision.
eugenis added reviewers: hctim, cryptoad.
eugenis requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

When built with hwasan, assume that the target architecture does not
support TBI. HWASan uses that byte for its own purpose, and changing it
breaks things.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111842

Files:
  compiler-rt/lib/scudo/standalone/memtag.h


Index: compiler-rt/lib/scudo/standalone/memtag.h
===================================================================
--- compiler-rt/lib/scudo/standalone/memtag.h
+++ compiler-rt/lib/scudo/standalone/memtag.h
@@ -23,7 +23,9 @@
 // We assume that Top-Byte Ignore is enabled if the architecture supports memory
 // tagging. Not all operating systems enable TBI, so we only claim architectural
 // support for memory tagging if the operating system enables TBI.
-#if SCUDO_LINUX && !defined(SCUDO_DISABLE_TBI)
+// HWASan uses the top byte for its own purpose and Scudo should not touch it.
+#if SCUDO_LINUX && !defined(SCUDO_DISABLE_TBI) &&                              \
+    !__has_feature(hwaddress_sanitizer)
 inline constexpr bool archSupportsMemoryTagging() { return true; }
 #else
 inline constexpr bool archSupportsMemoryTagging() { return false; }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111842.379844.patch
Type: text/x-patch
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211014/b1097c07/attachment.bin>


More information about the llvm-commits mailing list