Bug 1445167 - Part 2: Make LOG_FATAL messages in chromium sandbox code crash. r=jld, a=jcristau
authorBob Owen <bobowencode@gmail.com>
Tue, 20 Mar 2018 10:45:31 +0000
changeset 462839 0bea88fd85ba1b5a306b9b0df5a57b13e0726a19
parent 462838 0c055f790f2ed7e8c3ad84a1bd5e1fe85a726fb9
child 462840 a315114363461db1035fde0f8ed4e201bd6fcd77
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld, jcristau
bugs1445167
milestone60.0
Bug 1445167 - Part 2: Make LOG_FATAL messages in chromium sandbox code crash. r=jld, a=jcristau
security/sandbox/chromium-shim/base/logging.cpp
--- a/security/sandbox/chromium-shim/base/logging.cpp
+++ b/security/sandbox/chromium-shim/base/logging.cpp
@@ -23,16 +23,17 @@
 #endif
 
 #if defined(OS_WIN)
 #include "base/strings/utf_string_conversions.h"
 #endif
 
 #include <algorithm>
 
+#include "mozilla/Assertions.h"
 #include "mozilla/Unused.h"
 
 namespace logging {
 
 namespace {
 
 int g_min_log_level = 0;
 
@@ -110,16 +111,19 @@ LogMessage::LogMessage(const char* file,
 
 LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
                        std::string* result)
     : severity_(severity), file_(file), line_(line) {
   delete result;
 }
 
 LogMessage::~LogMessage() {
+  if (severity_ == LOG_FATAL) {
+    MOZ_CRASH("Hit fatal chromium sandbox condition.");
+  }
 }
 
 SystemErrorCode GetLastSystemErrorCode() {
 #if defined(OS_WIN)
   return ::GetLastError();
 #elif defined(OS_POSIX)
   return errno;
 #else