[all-commits] [llvm/llvm-project] 51fbab: [asan] Enable StackSafetyAnalysis by default

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jan 10 11:13:40 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 51fbab134560ece663517bf1e8c2a30300d08f1a
      https://github.com/llvm/llvm-project/commit/51fbab134560ece663517bf1e8c2a30300d08f1a
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    M compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp
    M compiler-rt/test/asan/TestCases/scariness_score_test.cpp
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    M llvm/test/Instrumentation/AddressSanitizer/asan-stack-safety.ll
    M llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
    M llvm/test/Instrumentation/AddressSanitizer/lifetime-uar-uas.ll
    M llvm/test/Instrumentation/AddressSanitizer/lifetime.ll
    M llvm/test/Instrumentation/AddressSanitizer/local_stack_base.ll
    M llvm/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll
    M llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll

  Log Message:
  -----------
  [asan] Enable StackSafetyAnalysis by default

StackSafetyAnalysis determines whether stack-allocated variables are
guaranteed to be safe from memory access bugs and enables the removal of
certain unneeded instrumentations.
(hwasan enables StackSafetyAnalysis in https://reviews.llvm.org/D108381)

Test updates:

* asan-stack-safety.ll: test the -asan-use-stack-safety=1 default
* lifetime-uar-uas.ll: switch to an indexed store to prevent
  StackSafetyAnalysis from optimizing out instrumentation for %c
* alloca_vla_interact.cpp: add a load to prevent StackSafetyAnalysis
  from optimizing out `__asan_alloca_poison` for the VLA `array`
* scariness_score_test.cpp: add -asan-use-stack-safety=0 to make a load
  of a `__asan_poison_memory_region`-poisoned local variable fail as
  intended.
* other .ll tests: add -asan-use-stack-safety=0

Reviewers: kstoimenov, eugenis, vitalybuka

Reviewed By: kstoimenov

Pull Request: https://github.com/llvm/llvm-project/pull/77210




More information about the All-commits mailing list