[PATCH] D124057: [asan] Enable detect_stack_use_after_return=1 by default

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 00:47:56 PDT 2022


vitalybuka updated this revision to Diff 425433.
vitalybuka added a comment.

redo


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124057

Files:
  clang/docs/AddressSanitizer.rst
  clang/docs/ReleaseNotes.rst
  compiler-rt/lib/asan/asan_flags.inc


Index: compiler-rt/lib/asan/asan_flags.inc
===================================================================
--- compiler-rt/lib/asan/asan_flags.inc
+++ compiler-rt/lib/asan/asan_flags.inc
@@ -49,7 +49,7 @@
     "to find more errors.")
 ASAN_FLAG(bool, replace_intrin, true,
           "If set, uses custom wrappers for memset/memcpy/memmove intrinsics.")
-ASAN_FLAG(bool, detect_stack_use_after_return, false,
+ASAN_FLAG(bool, detect_stack_use_after_return, !SANITIZER_WINDOWS,
           "Enables stack-use-after-return checking at run-time.")
 ASAN_FLAG(int, min_uar_stack_size_log, 16, // We can't do smaller anyway.
           "Minimum fake stack size log.")
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -178,7 +178,9 @@
   - Improve the dump format, dump both bitwidth(if its a bitfield) and field value.
   - Remove anonymous tag locations.
   - Beautify dump format, add indent for nested struct and struct members.
-- Enable MSAN_OPTIONS=poison_in_dtor=1 by default.
+- Previously disabled sanitizer options now enabled by default:
+  - ASAN_OPTIONS=detect_stack_use_after_return=1 (except Windows).
+  - MSAN_OPTIONS=poison_in_dtor=1.
 
 New Compiler Flags
 ------------------
Index: clang/docs/AddressSanitizer.rst
===================================================================
--- clang/docs/AddressSanitizer.rst
+++ clang/docs/AddressSanitizer.rst
@@ -15,7 +15,7 @@
 * Out-of-bounds accesses to heap, stack and globals
 * Use-after-free
 * Use-after-return (clang flag ``-fsanitize-address-use-after-return=(never|runtime|always)`` default: ``runtime``)
-    * Enable ``runtime`` with: ``ASAN_OPTIONS=detect_stack_use_after_return=1``
+    * Disable ``runtime`` with: ``ASAN_OPTIONS=detect_stack_use_after_return=0``
 * Use-after-scope (clang flag ``-fsanitize-address-use-after-scope``)
 * Double-free, invalid free
 * Memory leaks (experimental)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124057.425433.patch
Type: text/x-patch
Size: 1993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220427/17c3b7c6/attachment.bin>


More information about the llvm-commits mailing list