From 76e1e30f16d8de3e0de2dabcef3c774973b9dd9c Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 26 Jan 2021 15:53:11 -0800 Subject: Reland protobuf tombstones. This reverts the following commits: e156ede145a7fc671c705d045d89b49922a758b5. eda96eddcbdda9632166232b2363c7b84da0994d. 5ec54d1e843729cd1e38a2f791f001226a653e95. 1e45d3f2239333217d3252f78151f4294fda4e80. a50f61f8fa903117a6df82d164628de310f16ae9. Test: treehugger Test: atest -c CtsSeccompHostTestCases:android.seccomp.cts.SeccompHostJUnit4DeviceTest#testAppZygoteSyscalls Change-Id: Ic2b1f489ac9f1fec7d7a33c845c29891f4306bbd --- debuggerd/handler/debuggerd_fallback.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'debuggerd/handler/debuggerd_fallback.cpp') diff --git a/debuggerd/handler/debuggerd_fallback.cpp b/debuggerd/handler/debuggerd_fallback.cpp index e103c82f4..feafa7377 100644 --- a/debuggerd/handler/debuggerd_fallback.cpp +++ b/debuggerd/handler/debuggerd_fallback.cpp @@ -92,15 +92,15 @@ static void debuggerd_fallback_trace(int output_fd, ucontext_t* ucontext) { __linker_disable_fallback_allocator(); } -static void debuggerd_fallback_tombstone(int output_fd, ucontext_t* ucontext, siginfo_t* siginfo, - void* abort_message) { +static void debuggerd_fallback_tombstone(int output_fd, int proto_fd, ucontext_t* ucontext, + siginfo_t* siginfo, void* abort_message) { if (!__linker_enable_fallback_allocator()) { async_safe_format_log(ANDROID_LOG_ERROR, "libc", "fallback allocator already in use"); return; } - engrave_tombstone_ucontext(output_fd, reinterpret_cast(abort_message), siginfo, - ucontext); + engrave_tombstone_ucontext(output_fd, proto_fd, reinterpret_cast(abort_message), + siginfo, ucontext); __linker_disable_fallback_allocator(); } @@ -232,7 +232,8 @@ static void trace_handler(siginfo_t* info, ucontext_t* ucontext) { // Fetch output fd from tombstoned. unique_fd tombstone_socket, output_fd; - if (!tombstoned_connect(getpid(), &tombstone_socket, &output_fd, kDebuggerdNativeBacktrace)) { + if (!tombstoned_connect(getpid(), &tombstone_socket, &output_fd, nullptr, + kDebuggerdNativeBacktrace)) { async_safe_format_log(ANDROID_LOG_ERROR, "libc", "missing crash_dump_fallback() in selinux policy?"); goto exit; @@ -325,10 +326,10 @@ static void crash_handler(siginfo_t* info, ucontext_t* ucontext, void* abort_mes _exit(1); } - unique_fd tombstone_socket, output_fd; - bool tombstoned_connected = - tombstoned_connect(getpid(), &tombstone_socket, &output_fd, kDebuggerdTombstone); - debuggerd_fallback_tombstone(output_fd.get(), ucontext, info, abort_message); + unique_fd tombstone_socket, output_fd, proto_fd; + bool tombstoned_connected = tombstoned_connect(getpid(), &tombstone_socket, &output_fd, &proto_fd, + kDebuggerdTombstoneProto); + debuggerd_fallback_tombstone(output_fd.get(), proto_fd.get(), ucontext, info, abort_message); if (tombstoned_connected) { tombstoned_notify_completion(tombstone_socket.get()); } -- cgit v1.2.3