Commit 9203ef81 authored by shrikant's avatar shrikant Committed by Commit bot

Adding minidump creation when launching renderer process fails in appcontainer mode.

Also reenabled appcontainer for renderer and fixed policy use after free case.

BUG=468922,473715
R=cpu,jschuh@chromium.org, wfh

Review URL: https://codereview.chromium.org/1058373003

Cr-Commit-Position: refs/heads/master@{#324348}
parent 4e4c7e98
...@@ -335,6 +335,20 @@ class RendererSandboxedProcessLauncherDelegate ...@@ -335,6 +335,20 @@ class RendererSandboxedProcessLauncherDelegate
bool* success) { bool* success) {
AddBaseHandleClosePolicy(policy); AddBaseHandleClosePolicy(policy);
if (base::win::GetVersion() == base::win::VERSION_WIN8 ||
base::win::GetVersion() == base::win::VERSION_WIN8_1) {
// TODO(shrikant): Check if these constants should be different across
// various versions of Chromium code base or could be same.
// If there should be different SID per channel then move this code
// in chrome rather than content and assign SID based on
// VersionInfo::GetChannel().
const wchar_t kAppContainerSid[] =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012148-129201922";
policy->SetLowBox(kAppContainerSid);
}
GetContentClient()->browser()->PreSpawnRenderer(policy, success); GetContentClient()->browser()->PreSpawnRenderer(policy, success);
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/dump_without_crashing.h"
#include "base/debug/profiler.h" #include "base/debug/profiler.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/hash.h" #include "base/hash.h"
...@@ -728,7 +729,6 @@ base::Process StartSandboxedProcess( ...@@ -728,7 +729,6 @@ base::Process StartSandboxedProcess(
cmd_line->GetCommandLineString().c_str(), cmd_line->GetCommandLineString().c_str(),
policy, &temp_process_info); policy, &temp_process_info);
DWORD last_error = ::GetLastError(); DWORD last_error = ::GetLastError();
policy->Release();
base::win::ScopedProcessInformation target(temp_process_info); base::win::ScopedProcessInformation target(temp_process_info);
TRACE_EVENT_END_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); TRACE_EVENT_END_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0);
...@@ -745,10 +745,18 @@ base::Process StartSandboxedProcess( ...@@ -745,10 +745,18 @@ base::Process StartSandboxedProcess(
"Process.Sandbox.Lowbox.Launch.Error" : "Process.Sandbox.Lowbox.Launch.Error" :
"Process.Sandbox.Launch.Error", "Process.Sandbox.Launch.Error",
last_error); last_error);
// Trigger a minidump without crashing the browser.
// Note that this function will only generate minidump if content host
// has already done pre-setup by calling
// base::debug::SetDumpWithoutCrashingFunction
base::debug::DumpWithoutCrashing();
} else } else
DLOG(ERROR) << "Failed to launch process. Error: " << result; DLOG(ERROR) << "Failed to launch process. Error: " << result;
policy->Release();
return base::Process(); return base::Process();
} }
policy->Release();
if (delegate) if (delegate)
delegate->PostSpawnTarget(target.process_handle()); delegate->PostSpawnTarget(target.process_handle());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment