[scudo] Always exclude Tag 0
prepareTaggedChunk uses Tag 0 for header.
Android already PR_MTE_TAG_MASK to 0xfffe,
but with the patch we will not need to deppend
on the system configuration.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D103134
GitOrigin-RevId: ba04c7c128b1214edf8888b129f9e841852a629b
Change-Id: I4bb78ac7f872ed8bd275ab06d507aa04825ecefb
diff --git a/standalone/memtag.h b/standalone/memtag.h
index fec258b..26502e2 100644
--- a/standalone/memtag.h
+++ b/standalone/memtag.h
@@ -158,6 +158,7 @@
};
inline uptr selectRandomTag(uptr Ptr, uptr ExcludeMask) {
+ ExcludeMask |= 1; // Always exclude Tag 0.
uptr TaggedPtr;
__asm__ __volatile__(
R"(