[all-commits] [llvm/llvm-project] a62586: [GWP-ASan] Crash Handler API.

Mitch Phillips via All-commits all-commits at lists.llvm.org
Wed Feb 5 15:39:39 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a62586846fa90054bd9224912b07095d2fca662c
      https://github.com/llvm/llvm-project/commit/a62586846fa90054bd9224912b07095d2fca662c
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2020-02-05 (Wed, 05 Feb 2020)

  Changed paths:
    M compiler-rt/lib/gwp_asan/CMakeLists.txt
    A compiler-rt/lib/gwp_asan/common.cpp
    A compiler-rt/lib/gwp_asan/common.h
    A compiler-rt/lib/gwp_asan/crash_handler.cpp
    A compiler-rt/lib/gwp_asan/crash_handler.h
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
    M compiler-rt/lib/gwp_asan/optional/backtrace.h
    M compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp
    M compiler-rt/lib/gwp_asan/optional/backtrace_sanitizer_common.cpp
    M compiler-rt/lib/gwp_asan/optional/options_parser.cpp
    A compiler-rt/lib/gwp_asan/optional/segv_handler.h
    A compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
    M compiler-rt/lib/gwp_asan/options.h
    M compiler-rt/lib/gwp_asan/options.inc
    A compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp
    M compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp
    A compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
    M compiler-rt/lib/gwp_asan/random.cpp
    M compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
    M compiler-rt/lib/gwp_asan/tests/backtrace.cpp
    M compiler-rt/lib/gwp_asan/tests/basic.cpp
    A compiler-rt/lib/gwp_asan/tests/crash_handler_api.cpp
    M compiler-rt/lib/gwp_asan/tests/harness.h
    M compiler-rt/lib/gwp_asan/tests/optional/printf_sanitizer_common.cpp
    M compiler-rt/lib/gwp_asan/tests/thread_contention.cpp
    A compiler-rt/lib/gwp_asan/utilities.h
    M compiler-rt/lib/scudo/CMakeLists.txt
    M compiler-rt/lib/scudo/scudo_allocator.cpp
    M compiler-rt/lib/scudo/standalone/CMakeLists.txt
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
    M compiler-rt/test/gwp_asan/double_delete.cpp
    M compiler-rt/test/gwp_asan/double_deletea.cpp
    M compiler-rt/test/gwp_asan/double_free.cpp
    M compiler-rt/test/gwp_asan/heap_buffer_overflow.cpp
    M compiler-rt/test/gwp_asan/heap_buffer_underflow.cpp
    M compiler-rt/test/gwp_asan/invalid_free_left.cpp
    M compiler-rt/test/gwp_asan/invalid_free_right.cpp
    M compiler-rt/test/gwp_asan/realloc.cpp
    M compiler-rt/test/gwp_asan/use_after_delete.cpp
    M compiler-rt/test/gwp_asan/use_after_deletea.cpp
    M compiler-rt/test/gwp_asan/use_after_free.cpp

  Log Message:
  -----------
  [GWP-ASan] Crash Handler API.

Summary:
Forewarning: This patch looks big in #LOC changed. I promise it's not that bad, it just moves a lot of content from one file to another. I've gone ahead and left inline comments on Phabricator for sections where this has happened.

This patch:
 1. Introduces the crash handler API (crash_handler_api.h).
 2. Moves information required for out-of-process crash handling into an AllocatorState. This is a trivially-copied POD struct that designed to be recovered from a deceased process, and used by the crash handler to create a GWP-ASan report (along with the other trivially-copied Metadata struct).
 3. Implements the crash handler API using the AllocatorState and Metadata.
 4. Adds tests for the crash handler.
 5. Reimplements the (now optionally linked by the supporting allocator) in-process crash handler (i.e. the segv handler) using the new crash handler API.
 6. Minor updates Scudo & Scudo Standalone to fix compatibility.
 7. Changed capitalisation of errors (e.g. /s/Use after free/Use After Free).

Reviewers: cryptoad, eugenis, jfb

Reviewed By: eugenis

Subscribers: merge_guards_bot, pcc, jfb, dexonsmith, mgorny, cryptoad, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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




More information about the All-commits mailing list