[scudo] Don't enabled MTE for small alignment
authorVitaly Buka <vitalybuka@google.com>
Wed, 14 Jul 2021 01:11:57 +0000 (18:11 -0700)
committerVitaly Buka <vitalybuka@google.com>
Wed, 14 Jul 2021 19:04:16 +0000 (12:04 -0700)
Differential Revision: https://reviews.llvm.org/D105954

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

index cd8d95a..c48e228 100644 (file)
@@ -319,7 +319,8 @@ inline void *addFixedTag(void *Ptr, uptr Tag) {
 
 template <typename Config>
 inline constexpr bool allocatorSupportsMemoryTagging() {
-  return archSupportsMemoryTagging() && Config::MaySupportMemoryTagging;
+  return archSupportsMemoryTagging() && Config::MaySupportMemoryTagging &&
+         (1 << SCUDO_MIN_ALIGNMENT_LOG) >= archMemoryTagGranuleSize();
 }
 
 } // namespace scudo