[PATCH] D89552: ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1

Martin Liška via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 10:29:07 PDT 2020


This revision was automatically updated to reflect the committed changes.
marxin marked an inline comment as done.
Closed by commit rGad2be02a833e: ASAN: Support detect_invalid_pointer_pairs=1 with… (authored by marxin).
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89552/new/

https://reviews.llvm.org/D89552

Files:
  compiler-rt/lib/asan/asan_thread.cpp
  compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp


Index: compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
+++ compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
@@ -1,6 +1,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-detect-invalid-pointer-pair
 
 // RUN: %env_asan_opts=detect_invalid_pointer_pairs=2 %run %t
+// RUN: %env_asan_opts=detect_invalid_pointer_pairs=2,detect_stack_use_after_return=1 %run %t
 
 #include <assert.h>
 #include <stdlib.h>
Index: compiler-rt/lib/asan/asan_thread.cpp
===================================================================
--- compiler-rt/lib/asan/asan_thread.cpp
+++ compiler-rt/lib/asan/asan_thread.cpp
@@ -366,7 +366,9 @@
     bottom = stack_bottom();
   } else if (has_fake_stack()) {
     bottom = fake_stack()->AddrIsInFakeStack(addr);
-    CHECK(bottom);
+    if (bottom == 0) {
+      return 0;
+    }
   } else {
     return 0;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89552.299406.patch
Type: text/x-patch
Size: 1036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201020/a723ebd7/attachment.bin>


More information about the llvm-commits mailing list