| 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/zygote/zygote_main.h" | 5 #include "content/zygote/zygote_main.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <pthread.h> | 10 #include <pthread.h> |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 sandbox::SetuidSandboxClient* setuid_sandbox = | 326 sandbox::SetuidSandboxClient* setuid_sandbox = |
| 327 linux_sandbox->setuid_sandbox_client(); | 327 linux_sandbox->setuid_sandbox_client(); |
| 328 | 328 |
| 329 if (!setuid_sandbox) | 329 if (!setuid_sandbox) |
| 330 return false; | 330 return false; |
| 331 | 331 |
| 332 PreSandboxInit(); | 332 PreSandboxInit(); |
| 333 | 333 |
| 334 // Check that the pre-sandbox initialization didn't spawn threads. | 334 // Check that the pre-sandbox initialization didn't spawn threads. |
| 335 #if !defined(THREAD_SANITIZER) |
| 335 DCHECK(linux_sandbox->IsSingleThreaded()); | 336 DCHECK(linux_sandbox->IsSingleThreaded()); |
| 337 #endif |
| 336 | 338 |
| 337 if (setuid_sandbox->IsSuidSandboxChild()) { | 339 if (setuid_sandbox->IsSuidSandboxChild()) { |
| 338 // Use the SUID sandbox. This still allows the seccomp sandbox to | 340 // Use the SUID sandbox. This still allows the seccomp sandbox to |
| 339 // be enabled by the process later. | 341 // be enabled by the process later. |
| 340 *using_suid_sandbox = true; | 342 *using_suid_sandbox = true; |
| 341 | 343 |
| 342 if (!setuid_sandbox->IsSuidSandboxUpToDate()) { | 344 if (!setuid_sandbox->IsSuidSandboxUpToDate()) { |
| 343 LOG(WARNING) << "You are using a wrong version of the setuid binary!\n" | 345 LOG(WARNING) << "You are using a wrong version of the setuid binary!\n" |
| 344 "Please read " | 346 "Please read " |
| 345 "https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment." | 347 "https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment." |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 437 } |
| 436 | 438 |
| 437 int sandbox_flags = linux_sandbox->GetStatus(); | 439 int sandbox_flags = linux_sandbox->GetStatus(); |
| 438 | 440 |
| 439 Zygote zygote(sandbox_flags, forkdelegate); | 441 Zygote zygote(sandbox_flags, forkdelegate); |
| 440 // This function call can return multiple times, once per fork(). | 442 // This function call can return multiple times, once per fork(). |
| 441 return zygote.ProcessRequests(); | 443 return zygote.ProcessRequests(); |
| 442 } | 444 } |
| 443 | 445 |
| 444 } // namespace content | 446 } // namespace content |
| OLD | NEW |