[scudo] Don't enabled MTE for small alignment

Differential Revision: https://reviews.llvm.org/D105954
This commit is contained in:
Vitaly Buka 2021-07-13 18:11:57 -07:00
parent fbab8e6f10
commit 14362bf1b2
1 changed files with 2 additions and 1 deletions

View 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