summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorMitch Phillips <mitchp@google.com>2020-02-26 11:28:11 -0800
committerMitch Phillips <mitchp@google.com>2020-02-27 13:47:31 -0800
commit1f85474ee2c9aa3c1683faafac3cf5c10c4c5c79 (patch)
treebfa4ec4a2dd3cf08efb072981a41d3bfbb983d46 /libc/malloc_debug/malloc_debug.cpp
parentf6edd91305126cef8f382b1f72f177a0d1380c36 (diff)
[GWP-ASan] [heapprofd] Nullptr deref in dispatch.
Heapprofd uses an ephemeral dispatch table to ensure that GWP-ASan can be called during heapprofd initialization. Previously, we grabbed the backup dispatch table from the globals, which is wrong if GWP-ASan isn't installed (as the malloc_dispatch_table is linker-initialised and not set to a known good value if a malloc hooker isn't used). Instead, grab the correct ephemeral dispatch table. When GWP-ASan is installed, use a copy of its table as the dispatch. When nothing is installed, fall back to using the native allocator dispatch. Bug: 135634846 Bug: 150085813 Test: atest perfetto_integrationtests Test: TracedPerfCtsTest.SystemWideDebuggableApp on cuttlefish x86. Change-Id: I4beaf9192acadbe00adc02de2e0b0aab6f7a2190 Merged-In: I4beaf9192acadbe00adc02de2e0b0aab6f7a2190
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
0 files changed, 0 insertions, 0 deletions