| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 policy->SetJobMemoryLimit(4ULL * 1024 * 1024 * 1024); | 578 policy->SetJobMemoryLimit(4ULL * 1024 * 1024 * 1024); |
| 579 if (ret != sandbox::SBOX_ALL_OK) | 579 if (ret != sandbox::SBOX_ALL_OK) |
| 580 return ret; | 580 return ret; |
| 581 #endif | 581 #endif |
| 582 return policy->SetJobLevel(job_level, ui_exceptions); | 582 return policy->SetJobLevel(job_level, ui_exceptions); |
| 583 } | 583 } |
| 584 | 584 |
| 585 // TODO(jschuh): Need get these restrictions applied to NaCl and Pepper. | 585 // TODO(jschuh): Need get these restrictions applied to NaCl and Pepper. |
| 586 // Just have to figure out what needs to be warmed up first. | 586 // Just have to figure out what needs to be warmed up first. |
| 587 sandbox::ResultCode AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) { | 587 sandbox::ResultCode AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) { |
| 588 if (base::win::GetVersion() >= base::win::VERSION_WIN10) { |
| 589 // Close all ALPC ports. |
| 590 sandbox::ResultCode ret = |
| 591 policy->AddKernelObjectToClose(L"ALPC Port", NULL); |
| 592 if (ret != sandbox::SBOX_ALL_OK) { |
| 593 return ret; |
| 594 } |
| 595 } |
| 588 // TODO(cpu): Add back the BaseNamedObjects policy. | 596 // TODO(cpu): Add back the BaseNamedObjects policy. |
| 589 base::string16 object_path = PrependWindowsSessionPath( | 597 base::string16 object_path = PrependWindowsSessionPath( |
| 590 L"\\BaseNamedObjects\\windows_shell_global_counters"); | 598 L"\\BaseNamedObjects\\windows_shell_global_counters"); |
| 591 return policy->AddKernelObjectToClose(L"Section", object_path.data()); | 599 return policy->AddKernelObjectToClose(L"Section", object_path.data()); |
| 592 } | 600 } |
| 593 | 601 |
| 594 sandbox::ResultCode AddAppContainerPolicy(sandbox::TargetPolicy* policy, | 602 sandbox::ResultCode AddAppContainerPolicy(sandbox::TargetPolicy* policy, |
| 595 const wchar_t* sid) { | 603 const wchar_t* sid) { |
| 596 if (IsAppContainerEnabled()) | 604 if (IsAppContainerEnabled()) |
| 597 return policy->SetLowBox(sid); | 605 return policy->SetLowBox(sid); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 } | 840 } |
| 833 | 841 |
| 834 delegate->PostSpawnTarget(target.process_handle()); | 842 delegate->PostSpawnTarget(target.process_handle()); |
| 835 | 843 |
| 836 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); | 844 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); |
| 837 *process = base::Process(target.TakeProcessHandle()); | 845 *process = base::Process(target.TakeProcessHandle()); |
| 838 return sandbox::SBOX_ALL_OK; | 846 return sandbox::SBOX_ALL_OK; |
| 839 } | 847 } |
| 840 | 848 |
| 841 } // namespace content | 849 } // namespace content |
| OLD | NEW |