diff options
author | Peter Collingbourne <pcc@google.com> | 2021-01-06 21:02:19 -0800 |
---|---|---|
committer | Peter Collingbourne <pcc@google.com> | 2021-02-12 12:30:52 -0800 |
commit | bb4b49c63c64a622d1b4bc6df00c53a93b3da97d (patch) | |
tree | dcc9ca1dbafc17f287b394c51a0026c48be2f7d7 /debuggerd/libdebuggerd | |
parent | 7b204ac4cad6531e9d95fa25f787c01e889dd7af (diff) |
Teach debuggerd to pass the secondary ring buffer to __scudo_get_error_info().
With this change we can report memory errors involving secondary
allocations. Update the existing crasher tests to also test
UAF/overflow/underflow on allocations with sizes sufficient to trigger
the secondary allocator.
Bug: 135772972
Change-Id: Ic8925c1f18621a8f272e26d5630e5d11d6d34d38
Diffstat (limited to 'debuggerd/libdebuggerd')
-rw-r--r-- | debuggerd/libdebuggerd/include/libdebuggerd/types.h | 1 | ||||
-rw-r--r-- | debuggerd/libdebuggerd/scudo.cpp | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/debuggerd/libdebuggerd/include/libdebuggerd/types.h b/debuggerd/libdebuggerd/include/libdebuggerd/types.h index d5b07355f..dcb52f92a 100644 --- a/debuggerd/libdebuggerd/include/libdebuggerd/types.h +++ b/debuggerd/libdebuggerd/include/libdebuggerd/types.h @@ -46,6 +46,7 @@ struct ProcessInfo { uintptr_t gwp_asan_metadata = 0; uintptr_t scudo_stack_depot = 0; uintptr_t scudo_region_info = 0; + uintptr_t scudo_ring_buffer = 0; bool has_fault_address = false; uintptr_t untagged_fault_address = 0; diff --git a/debuggerd/libdebuggerd/scudo.cpp b/debuggerd/libdebuggerd/scudo.cpp index 141c3bd18..1c3437fde 100644 --- a/debuggerd/libdebuggerd/scudo.cpp +++ b/debuggerd/libdebuggerd/scudo.cpp @@ -43,6 +43,8 @@ ScudoCrashData::ScudoCrashData(unwindstack::Memory* process_memory, __scudo_get_stack_depot_size()); auto region_info = AllocAndReadFully(process_memory, process_info.scudo_region_info, __scudo_get_region_info_size()); + auto ring_buffer = AllocAndReadFully(process_memory, process_info.scudo_ring_buffer, + __scudo_get_ring_buffer_size()); untagged_fault_addr_ = process_info.untagged_fault_address; uintptr_t fault_page = untagged_fault_addr_ & ~(PAGE_SIZE - 1); @@ -68,8 +70,8 @@ ScudoCrashData::ScudoCrashData(unwindstack::Memory* process_memory, } __scudo_get_error_info(&error_info_, process_info.maybe_tagged_fault_address, stack_depot.get(), - region_info.get(), memory.get(), memory_tags.get(), memory_begin, - memory_end - memory_begin); + region_info.get(), ring_buffer.get(), memory.get(), memory_tags.get(), + memory_begin, memory_end - memory_begin); } bool ScudoCrashData::CrashIsMine() const { |