-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[scudo] Fix isOwned on MTE devices. #110717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If called on address that is actually not owned, the tags could not match. Disable tag checks in isOwned().
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Evgenii Stepanov (eugenis) ChangesIf called on address that is actually not owned, the tags could not match. Disable tag checks in isOwned(). Full diff: https://github.com/llvm/llvm-project/pull/110717.diff 1 Files Affected:
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;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious what was causing problem here, was the problem happened in the code of GuardedAlloc.pointerIsMine()
?
The problem was reading the header in Chunk::isValid. If you check the test for isOwned, the buffer for that is stack allocated, and not guaranteed to have any specific tag. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/51/builds/4583 Here is the relevant piece of the build log for the reference
|
This caused failures in aarch64 builders. This reverts commit 98c9523. (llvmorg-20-init-7659-g98c9523113b5)
Excuse me, I have reverted this. See, https://lab.llvm.org/buildbot/#/builders/51/builds/4583 |
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().
This caused failures in aarch64 builders. This reverts commit 98c9523. (llvmorg-20-init-7659-g98c9523113b5)
If called on address that is actually not owned, the tags could not match. Disable tag checks in isOwned().