| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 595 } |
| 596 | 596 |
| 597 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); | 597 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); |
| 598 | 598 |
| 599 sandbox::MitigationFlags mitigations = sandbox::MITIGATION_HEAP_TERMINATE | | 599 sandbox::MitigationFlags mitigations = sandbox::MITIGATION_HEAP_TERMINATE | |
| 600 sandbox::MITIGATION_BOTTOM_UP_ASLR | | 600 sandbox::MITIGATION_BOTTOM_UP_ASLR | |
| 601 sandbox::MITIGATION_DEP | | 601 sandbox::MITIGATION_DEP | |
| 602 sandbox::MITIGATION_DEP_NO_ATL_THUNK | | 602 sandbox::MITIGATION_DEP_NO_ATL_THUNK | |
| 603 sandbox::MITIGATION_SEHOP; | 603 sandbox::MITIGATION_SEHOP; |
| 604 | 604 |
| 605 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 606 type_str == switches::kRendererProcess && |
| 607 browser_command_line.HasSwitch( |
| 608 switches::kEnableWin32kRendererLockDown)) { |
| 609 mitigations |= sandbox::MITIGATION_WIN32K_DISABLE; |
| 610 } |
| 611 |
| 605 if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) | 612 if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) |
| 606 return 0; | 613 return 0; |
| 607 | 614 |
| 608 mitigations = sandbox::MITIGATION_STRICT_HANDLE_CHECKS | | 615 mitigations = sandbox::MITIGATION_STRICT_HANDLE_CHECKS | |
| 609 sandbox::MITIGATION_DLL_SEARCH_ORDER; | 616 sandbox::MITIGATION_DLL_SEARCH_ORDER; |
| 610 | 617 |
| 611 if (policy->SetDelayedProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) | 618 if (policy->SetDelayedProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) |
| 612 return 0; | 619 return 0; |
| 613 | 620 |
| 614 SetJobLevel(*cmd_line, sandbox::JOB_LOCKDOWN, 0, policy); | 621 SetJobLevel(*cmd_line, sandbox::JOB_LOCKDOWN, 0, policy); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 } | 737 } |
| 731 | 738 |
| 732 return false; | 739 return false; |
| 733 } | 740 } |
| 734 | 741 |
| 735 bool BrokerAddTargetPeer(HANDLE peer_process) { | 742 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 736 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 743 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 737 } | 744 } |
| 738 | 745 |
| 739 } // namespace content | 746 } // namespace content |
| OLD | NEW |