From 44356b590bbd8f03083f711d14d0fef4a3832334 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Mon, 14 Jan 2013 18:53:18 +0000 Subject: ExceptionHandler::HandleSignal (https://code.google.com/searchframe#OAMlx_jo-ck/src/breakpad/src/client/linux/handler/exception_handler.cc&exact_package=chromium&q=SI_USER&type=cs&l=389) requires si_pid to be equal to getpid() for SI_USER signals. This is a patch by Lei Zhang (thestig@chromium.org) that fixes the issue with Chrome+ASan being unable to upload the crash dump to the crash server when the seccomp sandbox is on. Patch by Alexander Potapenko Review URL: https://codereview.appspot.com/7066068/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1095 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/handler/exception_handler.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/linux/handler') diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index e6265a12..e62219d3 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -415,8 +415,11 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { // This is a public interface to HandleSignal that allows the client to // generate a crash dump. This function may run in a compromised context. bool ExceptionHandler::SimulateSignalDelivery(int sig) { - siginfo_t siginfo; - my_memset(&siginfo, 0, sizeof(siginfo_t)); + siginfo_t siginfo = {}; + // Mimic a trusted signal to allow tracing the process (see + // ExceptionHandler::HandleSignal(). + siginfo.si_code = SI_USER; + siginfo.si_pid = getpid(); struct ucontext context; getcontext(&context); return HandleSignal(sig, &siginfo, &context); -- cgit v1.2.1