[all-commits] [llvm/llvm-project] 137717: sanitizer_common: initialize sanitizer runtimes la...

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Thu Jul 13 07:28:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 13771793965bcda8951d6bdda1ea4ace658eca11
      https://github.com/llvm/llvm-project/commit/13771793965bcda8951d6bdda1ea4ace658eca11
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2023-07-13 (Thu, 13 Jul 2023)

  Changed paths:
    M compiler-rt/lib/asan/asan_interceptors.cpp
    M compiler-rt/lib/lsan/lsan_interceptors.cpp
    M compiler-rt/lib/msan/msan_interceptors.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc
    M compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
    M compiler-rt/lib/ubsan/ubsan_signals_standalone.cpp
    M compiler-rt/test/asan/lit.cfg.py
    M compiler-rt/test/lit.common.cfg.py
    A compiler-rt/test/ubsan/TestCases/Misc/Linux/sigaction.cpp

  Log Message:
  -----------
  sanitizer_common: initialize sanitizer runtimes lazily from signal interceptors

Currently if a program calls sigaction very early (before non-lazy sanitizer
initialization, in particular if .preinit_array initialization is not enabled),
then sigaction will wrongly fail since the interceptor is not initialized yet.

In all other interceptors we do lazy runtime initialization for this reason,
but we don't do it in the signal interceptors.
Do lazy runtime initialization in signal interceptors as well.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D155188




More information about the All-commits mailing list