[compiler-rt] ba04c7c - [scudo] Always exclude Tag 0

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 4 10:20:42 PDT 2021


Author: Vitaly Buka
Date: 2021-06-04T10:20:32-07:00
New Revision: ba04c7c128b1214edf8888b129f9e841852a629b

URL: https://github.com/llvm/llvm-project/commit/ba04c7c128b1214edf8888b129f9e841852a629b
DIFF: https://github.com/llvm/llvm-project/commit/ba04c7c128b1214edf8888b129f9e841852a629b.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/memtag.h b/compiler-rt/lib/scudo/standalone/memtag.h
index fec258b11a422..26502e2b1bade 100644
--- a/compiler-rt/lib/scudo/standalone/memtag.h
+++ b/compiler-rt/lib/scudo/standalone/memtag.h
@@ -158,6 +158,7 @@ class ScopedDisableMemoryTagChecks {
 };
 
 inline uptr selectRandomTag(uptr Ptr, uptr ExcludeMask) {
+  ExcludeMask |= 1; // Always exclude Tag 0.
   uptr TaggedPtr;
   __asm__ __volatile__(
       R"(


        


More information about the llvm-commits mailing list