Index: sandbox/linux/suid/sandbox.c |
diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c |
index 2dd78ef1eefbc8e68f8326e6bbb54b0dbfeb9195..5a9c3dc6ca889d76bd624496c835f752723eb664 100644 |
--- a/sandbox/linux/suid/sandbox.c |
+++ b/sandbox/linux/suid/sandbox.c |
@@ -58,6 +58,12 @@ static void FatalError(const char *msg, ...) { |
_exit(1); |
} |
+static void ExitWithErrorSignalHandler(int signal) { |
+ const char msg[] = "\nThe setuid sandbox got signaled, exiting.\n"; |
+ write(2, msg, sizeof(msg) - 1); |
+ _exit(1); |
+} |
+ |
// We will chroot() to the helper's /proc/self directory. Anything there will |
// not exist anymore if we make sure to wait() for the helper. |
// |
@@ -195,6 +201,15 @@ static void WaitForChildAndExit(pid_t child_pid) { |
int exit_code = -1; |
siginfo_t reaped_child_info; |
+ // Don't "Core" on SIGABRT. SIGABRT is sent by the Chrome OS session manager |
+ // when things are hanging. |
+ // Here, the current process is going to waitid() and _exit(), so there is no |
+ // point in generating a crash report. The child process is the one |
+ // blocking us. |
+ if (signal(SIGABRT, ExitWithErrorSignalHandler) == SIG_ERR) { |
+ FatalError("Failed to change signal handler"); |
+ } |
+ |
int wait_ret = |
HANDLE_EINTR(waitid(P_PID, child_pid, &reaped_child_info, WEXITED)); |