[compiler-rt] [scudo] Fix isOwned on MTE devices. (PR #110717)
Evgenii Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 11:15:04 PDT 2024
https://github.com/eugenis created https://github.com/llvm/llvm-project/pull/110717
If called on address that is actually not owned, the tags could not match. Disable tag checks in isOwned().
>From 680ffe3c09b953ed76906c0f1db114b9d2c57975 Mon Sep 17 00:00:00 2001
From: Evgenii Stepanov <eugenis at google.com>
Date: Tue, 1 Oct 2024 11:10:49 -0700
Subject: [PATCH] [scudo] Fix isOwned on MTE devices.
If called on address that is actually not owned, the tags could not
match. Disable tag checks in isOwned().
---
compiler-rt/lib/scudo/standalone/combined.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h
index a5f1bc388e8824..88fdc5943d6f81 100644
--- a/compiler-rt/lib/scudo/standalone/combined.h
+++ b/compiler-rt/lib/scudo/standalone/combined.h
@@ -785,6 +785,8 @@ class Allocator {
// A corrupted chunk will not be reported as owned, which is WAI.
bool isOwned(const void *Ptr) {
initThreadMaybe();
+ // If the allocation is not owned, the tags could be wrong.
+ ScopedDisableMemoryTagChecks x;
#ifdef GWP_ASAN_HOOKS
if (GuardedAlloc.pointerIsMine(Ptr))
return true;
More information about the llvm-commits
mailing list