From ba04c7c128b1214edf8888b129f9e841852a629b Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 28 May 2021 02:08:44 -0700 Subject: [PATCH] [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 --- compiler-rt/lib/scudo/standalone/memtag.h | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/scudo/standalone/memtag.h b/compiler-rt/lib/scudo/standalone/memtag.h index fec258b1..26502e2 100644 --- a/compiler-rt/lib/scudo/standalone/memtag.h +++ b/compiler-rt/lib/scudo/standalone/memtag.h @@ -158,6 +158,7 @@ public: }; inline uptr selectRandomTag(uptr Ptr, uptr ExcludeMask) { + ExcludeMask |= 1; // Always exclude Tag 0. uptr TaggedPtr; __asm__ __volatile__( R"( -- 2.7.4