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

Unified Diff: content/common/sandbox_policy.cc

Issue 7768004: Add GPU job object restriction (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_policy.cc
===================================================================
--- content/common/sandbox_policy.cc (revision 98433)
+++ content/common/sandbox_policy.cc (working copy)
@@ -287,16 +287,25 @@
// TODO(cpu): Lock down the sandbox more if possible.
// TODO(apatrick): Use D3D9Ex to render windowless.
bool AddPolicyForGPU(CommandLine* cmd_line, sandbox::TargetPolicy* policy) {
- policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0);
-
if (base::win::GetVersion() > base::win::VERSION_XP) {
policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
sandbox::USER_LIMITED);
if (cmd_line->GetSwitchValueASCII(switches::kUseGL) ==
- gfx::kGLImplementationDesktopName)
+ gfx::kGLImplementationDesktopName) {
+ policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0);
+ policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
+ } else {
+ // UI restrictions break when we access Windows from outside our job.
+ // However, we don't want a proxy window in this process because it can
+ // introduce deadlocks. So, the only job restriction we pick up here is
brettw 2011/08/27 23:06:47 It might be nice to mention here quickly how such
jschuh 2011/08/29 16:13:58 Done.
+ // to prevent child processes.
+ policy->SetJobLevel(sandbox::JOB_LIMITED_USER,
+ JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS |
+ JOB_OBJECT_UILIMIT_DESKTOP |
+ JOB_OBJECT_UILIMIT_EXITWINDOWS |
+ JOB_OBJECT_UILIMIT_DISPLAYSETTINGS);
policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
- else
- policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
+ }
} else {
policy->SetTokenLevel(sandbox::USER_UNPROTECTED,
sandbox::USER_LIMITED);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698