[PATCH] D73557: [GWP-ASan] Crash Handler API.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 07:36:15 PST 2020


hctim created this revision.
Herald added subscribers: llvm-commits, Sanitizers, cryptoad, mgorny.
Herald added a reviewer: jfb.
Herald added projects: Sanitizers, LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73557

Files:
  compiler-rt/lib/gwp_asan/CMakeLists.txt
  compiler-rt/lib/gwp_asan/crash_handler_interface.h
  compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
  compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
  compiler-rt/lib/gwp_asan/optional/backtrace.h
  compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp
  compiler-rt/lib/gwp_asan/optional/backtrace_sanitizer_common.cpp
  compiler-rt/lib/gwp_asan/optional/crash_handler.h
  compiler-rt/lib/gwp_asan/optional/crash_handler_posix.cpp
  compiler-rt/lib/gwp_asan/optional/options_parser.cpp
  compiler-rt/lib/gwp_asan/options.h
  compiler-rt/lib/gwp_asan/options.inc
  compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp
  compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
  compiler-rt/lib/gwp_asan/tests/backtrace.cpp
  compiler-rt/lib/gwp_asan/tests/basic.cpp
  compiler-rt/lib/gwp_asan/tests/crash_handler_api.cpp
  compiler-rt/lib/gwp_asan/tests/harness.h
  compiler-rt/lib/gwp_asan/tests/optional/printf_sanitizer_common.cpp
  compiler-rt/lib/gwp_asan/tests/thread_contention.cpp
  compiler-rt/lib/scudo/CMakeLists.txt
  compiler-rt/lib/scudo/scudo_allocator.cpp
  compiler-rt/lib/scudo/standalone/CMakeLists.txt
  compiler-rt/lib/scudo/standalone/combined.h
  compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
  compiler-rt/test/gwp_asan/double_delete.cpp
  compiler-rt/test/gwp_asan/double_deletea.cpp
  compiler-rt/test/gwp_asan/double_free.cpp
  compiler-rt/test/gwp_asan/heap_buffer_overflow.cpp
  compiler-rt/test/gwp_asan/heap_buffer_underflow.cpp
  compiler-rt/test/gwp_asan/invalid_free_left.cpp
  compiler-rt/test/gwp_asan/invalid_free_right.cpp
  compiler-rt/test/gwp_asan/realloc.cpp
  compiler-rt/test/gwp_asan/use_after_delete.cpp
  compiler-rt/test/gwp_asan/use_after_deletea.cpp
  compiler-rt/test/gwp_asan/use_after_free.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73557.240885.patch
Type: text/x-patch
Size: 104642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200128/ffbdcb94/attachment.bin>


More information about the llvm-commits mailing list