Skip to content

Commit 98c9523

Browse files
authored
[scudo] Fix isOwned on MTE devices. (#110717)
If called on an address that is actually not owned, the header tag might not match. This would cause an MTE fault in Chunk::isValid. Disable tag checks in isOwned().
1 parent 9ec229d commit 98c9523

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler-rt/lib/scudo/standalone/combined.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ class Allocator {
785785
// A corrupted chunk will not be reported as owned, which is WAI.
786786
bool isOwned(const void *Ptr) {
787787
initThreadMaybe();
788+
// If the allocation is not owned, the tags could be wrong.
789+
ScopedDisableMemoryTagChecks x;
788790
#ifdef GWP_ASAN_HOOKS
789791
if (GuardedAlloc.pointerIsMine(Ptr))
790792
return true;

0 commit comments

Comments
 (0)