[all-commits] [llvm/llvm-project] 1f55fa: scudo: Add support for tracking stack traces of se...

pcc via All-commits all-commits at lists.llvm.org
Tue Mar 9 11:43:49 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f55fa0b99e0755c96bfd5cd0cdbe9cbc26fe2db
      https://github.com/llvm/llvm-project/commit/1f55fa0b99e0755c96bfd5cd0cdbe9cbc26fe2db
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp
    M compiler-rt/lib/scudo/standalone/include/scudo/interface.h
    M compiler-rt/lib/scudo/standalone/memtag.h
    M compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp

  Log Message:
  -----------
  scudo: Add support for tracking stack traces of secondary allocations.

There is no centralized store of information related to secondary
allocations. Moreover the allocations themselves become inaccessible
when the allocation is freed in order to implement UAF detection,
so we can't store information there to be used in case of UAF
anyway.

Therefore our storage location for tracking stack traces of secondary
allocations is a ring buffer. The ring buffer is copied to the process
creating the crash dump when a fault occurs.

The ring buffer is also used to store stack traces for primary
deallocations. Stack traces for primary allocations continue to be
stored inline.

In order to support the scenario where an access to the ring buffer
is interrupted by a concurrently occurring crash, the ring buffer is
accessed in a lock-free manner.

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




More information about the All-commits mailing list