[compiler-rt] a8a8516 - Revert "[Asan] Accept __lsan_ignore_object for redzone pointer"
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 00:36:45 PDT 2020
Author: Vitaly Buka
Date: 2020-09-16T00:34:43-07:00
New Revision: a8a85166d81f573af7ff325fdf93dd8bdfdeddbf
URL: https://github.com/llvm/llvm-project/commit/a8a85166d81f573af7ff325fdf93dd8bdfdeddbf
DIFF: https://github.com/llvm/llvm-project/commit/a8a85166d81f573af7ff325fdf93dd8bdfdeddbf.diff
LOG: Revert "[Asan] Accept __lsan_ignore_object for redzone pointer"
We still keep AddrIsInside.
This reverts commit 1d70984fa220f966ddcecd7906c5f10368fe1b93.
Added:
Modified:
compiler-rt/lib/asan/asan_allocator.cpp
compiler-rt/test/asan/TestCases/lsan_annotations.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_allocator.cpp b/compiler-rt/lib/asan/asan_allocator.cpp
index 691f64c0ef362..58b496a3ca4b1 100644
--- a/compiler-rt/lib/asan/asan_allocator.cpp
+++ b/compiler-rt/lib/asan/asan_allocator.cpp
@@ -1172,8 +1172,10 @@ void ForEachChunk(ForEachChunkCallback callback, void *arg) {
IgnoreObjectResult IgnoreObjectLocked(const void *p) {
uptr addr = reinterpret_cast<uptr>(p);
__asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddr(addr);
- if (!m || (atomic_load(&m->chunk_state, memory_order_acquire) !=
- __asan::CHUNK_ALLOCATED)) {
+ if (!m ||
+ (atomic_load(&m->chunk_state, memory_order_acquire) !=
+ __asan::CHUNK_ALLOCATED) ||
+ !m->AddrIsInside(addr)) {
return kIgnoreObjectInvalid;
}
if (m->lsan_tag == kIgnored)
diff --git a/compiler-rt/test/asan/TestCases/lsan_annotations.cpp b/compiler-rt/test/asan/TestCases/lsan_annotations.cpp
index ce7c19b8f2d05..158c2fdf9f481 100644
--- a/compiler-rt/test/asan/TestCases/lsan_annotations.cpp
+++ b/compiler-rt/test/asan/TestCases/lsan_annotations.cpp
@@ -5,7 +5,7 @@
#include <sanitizer/lsan_interface.h>
#include <stdlib.h>
-int *x, *y, *z;
+int *x, *y;
int main() {
x = new int;
@@ -16,9 +16,6 @@ int main() {
y = new int;
}
- z = new int;
- __lsan_ignore_object(z - 1);
-
- x = y = z = nullptr;
+ x = y = nullptr;
return 0;
}
More information about the llvm-commits
mailing list