| OLD | NEW |
| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 debug_message = debug_message.AppendASCII("debug_message.exe"); | 327 debug_message = debug_message.AppendASCII("debug_message.exe"); |
| 328 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS, | 328 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS, |
| 329 sandbox::TargetPolicy::PROCESS_MIN_EXEC, | 329 sandbox::TargetPolicy::PROCESS_MIN_EXEC, |
| 330 debug_message.value().c_str()); | 330 debug_message.value().c_str()); |
| 331 if (result != sandbox::SBOX_ALL_OK) | 331 if (result != sandbox::SBOX_ALL_OK) |
| 332 return false; | 332 return false; |
| 333 #endif // NDEBUG | 333 #endif // NDEBUG |
| 334 | 334 |
| 335 AddGenericDllEvictionPolicy(policy); | 335 AddGenericDllEvictionPolicy(policy); |
| 336 | 336 |
| 337 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| 338 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_WIN32K_LOCKDOWN, |
| 339 sandbox::TargetPolicy::LOCKDOWN_WIN32K, |
| 340 L"Lockdown_Win32K"); |
| 341 if (result != sandbox::SBOX_ALL_OK) |
| 342 return false; |
| 343 } |
| 337 return true; | 344 return true; |
| 338 } | 345 } |
| 339 | 346 |
| 340 bool AddPolicyForSandboxedProcess(sandbox::TargetPolicy* policy) { | 347 bool AddPolicyForSandboxedProcess(sandbox::TargetPolicy* policy) { |
| 341 sandbox::ResultCode result; | 348 sandbox::ResultCode result; |
| 342 // Renderers need to share events with plugins. | 349 // Renderers need to share events with plugins. |
| 343 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, | 350 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, |
| 344 sandbox::TargetPolicy::HANDLES_DUP_ANY, | 351 sandbox::TargetPolicy::HANDLES_DUP_ANY, |
| 345 L"Event"); | 352 L"Event"); |
| 346 if (result != sandbox::SBOX_ALL_OK) | 353 if (result != sandbox::SBOX_ALL_OK) |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 } | 748 } |
| 742 | 749 |
| 743 return false; | 750 return false; |
| 744 } | 751 } |
| 745 | 752 |
| 746 bool BrokerAddTargetPeer(HANDLE peer_process) { | 753 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 747 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 754 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 748 } | 755 } |
| 749 | 756 |
| 750 } // namespace content | 757 } // namespace content |
| OLD | NEW |