| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 // Pre-startup mitigations. | 696 // Pre-startup mitigations. |
| 697 sandbox::MitigationFlags mitigations = | 697 sandbox::MitigationFlags mitigations = |
| 698 sandbox::MITIGATION_HEAP_TERMINATE | | 698 sandbox::MITIGATION_HEAP_TERMINATE | |
| 699 sandbox::MITIGATION_BOTTOM_UP_ASLR | | 699 sandbox::MITIGATION_BOTTOM_UP_ASLR | |
| 700 sandbox::MITIGATION_DEP | | 700 sandbox::MITIGATION_DEP | |
| 701 sandbox::MITIGATION_DEP_NO_ATL_THUNK | | 701 sandbox::MITIGATION_DEP_NO_ATL_THUNK | |
| 702 sandbox::MITIGATION_SEHOP | | 702 sandbox::MITIGATION_SEHOP | |
| 703 sandbox::MITIGATION_NONSYSTEM_FONT_DISABLE | | 703 sandbox::MITIGATION_NONSYSTEM_FONT_DISABLE | |
| 704 sandbox::MITIGATION_IMAGE_LOAD_NO_REMOTE | | 704 sandbox::MITIGATION_IMAGE_LOAD_NO_REMOTE | |
| 705 sandbox::MITIGATION_IMAGE_LOAD_NO_LOW_LABEL; | 705 sandbox::MITIGATION_IMAGE_LOAD_NO_LOW_LABEL; |
| 706 #if !defined(NACL_WIN64) |
| 707 // Don't block font loading with GDI. |
| 708 if (!gfx::win::ShouldUseDirectWrite()) |
| 709 mitigations ^= sandbox::MITIGATION_NONSYSTEM_FONT_DISABLE; |
| 710 #endif |
| 706 | 711 |
| 707 if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) | 712 if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK) |
| 708 return base::Process(); | 713 return base::Process(); |
| 709 | 714 |
| 710 #if !defined(NACL_WIN64) | 715 #if !defined(NACL_WIN64) |
| 711 if (type_str == switches::kRendererProcess && | 716 if (type_str == switches::kRendererProcess && |
| 712 IsWin32kRendererLockdownEnabled()) { | 717 IsWin32kRendererLockdownEnabled()) { |
| 713 if (!AddWin32kLockdownPolicy(policy)) | 718 if (!AddWin32kLockdownPolicy(policy)) |
| 714 return base::Process(); | 719 return base::Process(); |
| 715 } | 720 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 } | 865 } |
| 861 | 866 |
| 862 return false; | 867 return false; |
| 863 } | 868 } |
| 864 | 869 |
| 865 bool BrokerAddTargetPeer(HANDLE peer_process) { | 870 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 866 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 871 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 867 } | 872 } |
| 868 | 873 |
| 869 } // namespace content | 874 } // namespace content |
| OLD | NEW |