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 cmd_line->HasSwitch(switches::kEnableGDIUser32RendererLockDown)) { |
| 608 mitigations |= sandbox::MITIGATION_WIN32K_DISABLE; |
| 609 } |
| 610 |
605 if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) | 611 if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) |
606 return 0; | 612 return 0; |
607 | 613 |
608 mitigations = sandbox::MITIGATION_STRICT_HANDLE_CHECKS | | 614 mitigations = sandbox::MITIGATION_STRICT_HANDLE_CHECKS | |
609 sandbox::MITIGATION_DLL_SEARCH_ORDER; | 615 sandbox::MITIGATION_DLL_SEARCH_ORDER; |
610 | 616 |
611 if (policy->SetDelayedProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) | 617 if (policy->SetDelayedProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) |
612 return 0; | 618 return 0; |
613 | 619 |
614 SetJobLevel(*cmd_line, sandbox::JOB_LOCKDOWN, 0, policy); | 620 SetJobLevel(*cmd_line, sandbox::JOB_LOCKDOWN, 0, policy); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 } | 736 } |
731 | 737 |
732 return false; | 738 return false; |
733 } | 739 } |
734 | 740 |
735 bool BrokerAddTargetPeer(HANDLE peer_process) { | 741 bool BrokerAddTargetPeer(HANDLE peer_process) { |
736 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 742 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
737 } | 743 } |
738 | 744 |
739 } // namespace content | 745 } // namespace content |
OLD | NEW |