Commit 3ba92071 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[content] Disable V8 untrusted code mitigations when site isolation is enabled.

BUG=866721

Change-Id: I90a280e0d59fbc9d258e3c42a7227348b06f1ef2
Reviewed-on: https://chromium-review.googlesource.com/1150527Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579643}
parent c5c6ec49
......@@ -2716,6 +2716,11 @@ void RenderProcessHostImpl::AppendRendererCommandLine(
child_connection_->service_token());
command_line->AppendSwitchASCII(switches::kRendererClientId,
std::to_string(GetID()));
if (SiteIsolationPolicy::UseDedicatedProcessesForAllSites()) {
// Disable V8 code mitigations if renderer processes are site-isolated.
command_line->AppendSwitch(switches::kNoV8UntrustedCodeMitigations);
}
}
void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
......
......@@ -624,6 +624,9 @@ const char kMojoLocalStorage[] = "mojo-local-storage";
// zygote to work.
const char kNoZygote[] = "no-zygote";
// Disables V8 mitigations for executing untrusted code.
const char kNoV8UntrustedCodeMitigations[] = "no-v8-untrusted-code-mitigations";
// Number of worker threads used to rasterize content.
const char kNumRasterThreads[] = "num-raster-threads";
......
......@@ -186,6 +186,7 @@ CONTENT_EXPORT extern const char kMHTMLSkipNostoreMain[];
CONTENT_EXPORT extern const char kMHTMLSkipNostoreAll[];
CONTENT_EXPORT extern const char kMojoLocalStorage[];
CONTENT_EXPORT extern const char kNoZygote[];
extern const char kNoV8UntrustedCodeMitigations[];
CONTENT_EXPORT extern const char kEnableAppContainer[];
CONTENT_EXPORT extern const char kDisableAppContainer[];
CONTENT_EXPORT extern const char kNumRasterThreads[];
......
......@@ -191,6 +191,12 @@ RenderProcessImpl::RenderProcessImpl(
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kNoV8UntrustedCodeMitigations)) {
const char* disable_mitigations = "--no-untrusted-code-mitigations";
v8::V8::SetFlagsFromString(disable_mitigations,
strlen(disable_mitigations));
}
if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
std::string flags(
command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
......
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