[clang] c1e9459 - Revert "[asan] Enable detect_stack_use_after_return=1 by default"

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 00:43:53 PDT 2022


Author: Vitaly Buka
Date: 2022-04-27T00:43:39-07:00
New Revision: c1e94591bcc95f36da0372080c455b09af8c46fd

URL: https://github.com/llvm/llvm-project/commit/c1e94591bcc95f36da0372080c455b09af8c46fd
DIFF: https://github.com/llvm/llvm-project/commit/c1e94591bcc95f36da0372080c455b09af8c46fd.diff

LOG: Revert "[asan] Enable detect_stack_use_after_return=1 by default"

Temporarily revert the option to fix
https://bugs.chromium.org/p/chromium/issues/detail?id=1319387

This reverts option default and documentation of the commit. Test
changes are not being reverted as they are improvement and break
reliance on option defaults.

Additional memory usage is a problem on mobile devices with low memory.
Even heavy thread desktop programs may need some FakeStack tunning.

This reverts commit 4b4437c084e2b8a2643e97e7aef125c438635a4d.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/docs/AddressSanitizer.rst b/clang/docs/AddressSanitizer.rst
index ca5c052b615f5..cc51a8d8a34fd 100644
--- a/clang/docs/AddressSanitizer.rst
+++ b/clang/docs/AddressSanitizer.rst
@@ -15,7 +15,7 @@ following types of bugs:
 * 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``)
-    * Disable ``runtime`` with: ``ASAN_OPTIONS=detect_stack_use_after_return=0``
+    * Enable ``runtime`` with: ``ASAN_OPTIONS=detect_stack_use_after_return=1``
 * Use-after-scope (clang flag ``-fsanitize-address-use-after-scope``)
 * Double-free, invalid free
 * Memory leaks (experimental)

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index e78167bad589e..2dacf3a94cdff 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -178,9 +178,7 @@ Non-comprehensive list of changes in this release
   - 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.
-- Previously disabled sanitizer options now enabled by default:
-  - ASAN_OPTIONS=detect_stack_use_after_return=1 (except Windows).
-  - MSAN_OPTIONS=poison_in_dtor=1.
+- Enable MSAN_OPTIONS=poison_in_dtor=1 by default.
 
 New Compiler Flags
 ------------------

diff  --git a/compiler-rt/lib/asan/asan_flags.inc b/compiler-rt/lib/asan/asan_flags.inc
index 04023234bc945..514b225c40731 100644
--- a/compiler-rt/lib/asan/asan_flags.inc
+++ b/compiler-rt/lib/asan/asan_flags.inc
@@ -49,7 +49,7 @@ ASAN_FLAG(
     "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, !SANITIZER_WINDOWS,
+ASAN_FLAG(bool, detect_stack_use_after_return, false,
           "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.")


        


More information about the cfe-commits mailing list