OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_policy.h" | 5 #include "content/common/sandbox_policy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 return *session_prefix + object; | 216 return *session_prefix + object; |
217 } | 217 } |
218 | 218 |
219 // Closes handles that are opened at process creation and initialization. | 219 // Closes handles that are opened at process creation and initialization. |
220 void AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) { | 220 void AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) { |
221 // Being able to manipulate anything BaseNamedObjects is bad. | 221 // Being able to manipulate anything BaseNamedObjects is bad. |
222 policy->AddKernelObjectToClose(L"Directory", PrependWindowsSessionPath( | 222 policy->AddKernelObjectToClose(L"Directory", PrependWindowsSessionPath( |
223 L"\\BaseNamedObjects").data()); | 223 L"\\BaseNamedObjects").data()); |
224 policy->AddKernelObjectToClose(L"Section", PrependWindowsSessionPath( | 224 policy->AddKernelObjectToClose(L"Section", PrependWindowsSessionPath( |
225 L"\\BaseNamedObjects\\windows_shell_global_counters").data()); | 225 L"\\BaseNamedObjects\\windows_shell_global_counters").data()); |
226 // These are the CSRSS and LSASS handles opened at initialization. | |
227 policy->AddKernelObjectToClose(L"ALPC Port", NULL); | |
228 } | 226 } |
229 | 227 |
230 // Adds the generic policy rules to a sandbox TargetPolicy. | 228 // Adds the generic policy rules to a sandbox TargetPolicy. |
231 bool AddGenericPolicy(sandbox::TargetPolicy* policy) { | 229 bool AddGenericPolicy(sandbox::TargetPolicy* policy) { |
232 sandbox::ResultCode result; | 230 sandbox::ResultCode result; |
233 | 231 |
234 // Add the policy for the pipes | 232 // Add the policy for the pipes |
235 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 233 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
236 sandbox::TargetPolicy::FILES_ALLOW_ANY, | 234 sandbox::TargetPolicy::FILES_ALLOW_ANY, |
237 L"\\??\\pipe\\chrome.*"); | 235 L"\\??\\pipe\\chrome.*"); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 503 |
506 // Help the process a little. It can't start the debugger by itself if | 504 // Help the process a little. It can't start the debugger by itself if |
507 // the process is in a sandbox. | 505 // the process is in a sandbox. |
508 if (child_needs_help) | 506 if (child_needs_help) |
509 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 507 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
510 | 508 |
511 return process; | 509 return process; |
512 } | 510 } |
513 | 511 |
514 } // namespace sandbox | 512 } // namespace sandbox |
OLD | NEW |