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

Side by Side Diff: content/common/sandbox_win.cc

Issue 290053003: Close DeviceApi in Win8+ lockdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/sandbox_win.h" 5 #include "content/common/sandbox_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 bool AddPolicyForSandboxedProcess(sandbox::TargetPolicy* policy) { 337 bool AddPolicyForSandboxedProcess(sandbox::TargetPolicy* policy) {
338 sandbox::ResultCode result; 338 sandbox::ResultCode result;
339 // Renderers need to share events with plugins. 339 // Renderers need to share events with plugins.
340 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, 340 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES,
341 sandbox::TargetPolicy::HANDLES_DUP_ANY, 341 sandbox::TargetPolicy::HANDLES_DUP_ANY,
342 L"Event"); 342 L"Event");
343 if (result != sandbox::SBOX_ALL_OK) 343 if (result != sandbox::SBOX_ALL_OK)
344 return false; 344 return false;
345 345
346 // Win8+ adds a device DeviceApi that we don't need.
347 if (base::win::GetVersion() > base::win::VERSION_WIN7)
348 policy->AddKernelObjectToClose(L"File", L"\\Device\\DeviceApi");
349
346 sandbox::TokenLevel initial_token = sandbox::USER_UNPROTECTED; 350 sandbox::TokenLevel initial_token = sandbox::USER_UNPROTECTED;
347 if (base::win::GetVersion() > base::win::VERSION_XP) { 351 if (base::win::GetVersion() > base::win::VERSION_XP) {
348 // On 2003/Vista the initial token has to be restricted if the main 352 // On 2003/Vista the initial token has to be restricted if the main
349 // token is restricted. 353 // token is restricted.
350 initial_token = sandbox::USER_RESTRICTED_SAME_ACCESS; 354 initial_token = sandbox::USER_RESTRICTED_SAME_ACCESS;
351 } 355 }
352 356
353 policy->SetTokenLevel(initial_token, sandbox::USER_LOCKDOWN); 357 policy->SetTokenLevel(initial_token, sandbox::USER_LOCKDOWN);
354 // Prevents the renderers from manipulating low-integrity processes. 358 // Prevents the renderers from manipulating low-integrity processes.
355 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_UNTRUSTED); 359 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_UNTRUSTED);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 } 734 }
731 735
732 return false; 736 return false;
733 } 737 }
734 738
735 bool BrokerAddTargetPeer(HANDLE peer_process) { 739 bool BrokerAddTargetPeer(HANDLE peer_process) {
736 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 740 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
737 } 741 }
738 742
739 } // namespace content 743 } // namespace content
OLDNEW
« 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