[all-commits] [llvm/llvm-project] e78b64: [Scudo] Use GWP-ASan's aligned allocations and fix...

Mitch Phillips via All-commits all-commits at lists.llvm.org
Mon May 10 12:58:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e78b64df98878d1da56275e0c272ed58364da3ad
      https://github.com/llvm/llvm-project/commit/e78b64df98878d1da56275e0c272ed58364da3ad
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2021-05-10 (Mon, 10 May 2021)

  Changed paths:
    M compiler-rt/lib/gwp_asan/common.h
    M compiler-rt/lib/scudo/scudo_allocator.cpp
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/stats.h
    M compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
    M compiler-rt/test/scudo/standalone/CMakeLists.txt
    A compiler-rt/test/scudo/standalone/unit/gwp_asan/lit.site.cfg.py.in

  Log Message:
  -----------
  [Scudo] Use GWP-ASan's aligned allocations and fixup postalloc hooks.

This patch does a few cleanup things:
 1. The non-standalone scudo has a problem where GWP-ASan allocations
 may not meet alignment requirements where Scudo was requested to have
 alignment >= 16. Use the new GWP-ASan API to fix this.
 2. The standalone variant loses some debugging information inside of
 GWP-ASan because we ask GWP-ASan to allocate an aligned size in the
 frontend. This means reports end up with 'UaF on a 16-byte allocation'
 for a 1-byte allocation with 16-byte alignment. Also use the new API to
 fix this.
 3. Add post-alloc hooks for GWP-ASan intercepted allocations, and add
 stats tracking for GWP-ASan allocations.
 4. Add a small test that checks the alignment of the frontend
 allocator, so that it can be used under GWP-ASan torture mode.
 5. Add GWP-ASan torture mode as a testing configuration to catch these
 regressions.

Depends on D94830, D95889.

Reviewed By: cryptoad

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




More information about the All-commits mailing list