Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: content/common/sandbox_win.cc

Issue 1924723002: Enabled OPM redirection policy for PPAPI processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opm_drm_fixes
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_win.cc
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index 66a279ef9d17319fd6de314ba375ca4e17e0bfb9..44811d0fb0a56a894c141cfb441682b3e0df3290 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -576,7 +576,7 @@ void AddAppContainerPolicy(sandbox::TargetPolicy* policy, const wchar_t* sid) {
policy->SetLowBox(sid);
}
-bool AddWin32kLockdownPolicy(sandbox::TargetPolicy* policy) {
+bool AddWin32kLockdownPolicy(sandbox::TargetPolicy* policy, bool enable_opm) {
#if !defined(NACL_WIN64)
if (!IsWin32kRendererLockdownEnabled())
return true;
@@ -589,10 +589,13 @@ bool AddWin32kLockdownPolicy(sandbox::TargetPolicy* policy) {
sandbox::ResultCode result =
policy->AddRule(sandbox::TargetPolicy::SUBSYS_WIN32K_LOCKDOWN,
- sandbox::TargetPolicy::FAKE_USER_GDI_INIT, nullptr);
+ enable_opm ? sandbox::TargetPolicy::IMPLEMENT_OPM_APIS
+ : sandbox::TargetPolicy::FAKE_USER_GDI_INIT,
+ nullptr);
if (result != sandbox::SBOX_ALL_OK)
return false;
-
+ if (enable_opm)
+ policy->SetEnableOPMRedirection();
flags |= sandbox::MITIGATION_WIN32K_DISABLE;
result = policy->SetProcessMitigations(flags);
if (result != sandbox::SBOX_ALL_OK)
@@ -712,7 +715,7 @@ base::Process StartSandboxedProcess(
#if !defined(NACL_WIN64)
if (type_str == switches::kRendererProcess &&
IsWin32kRendererLockdownEnabled()) {
- if (!AddWin32kLockdownPolicy(policy))
+ if (!AddWin32kLockdownPolicy(policy, false))
return base::Process();
}
#endif
« no previous file with comments | « content/common/sandbox_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698