| 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 <dirent.h> | 5 #include <dirent.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <sys/resource.h> | 7 #include <sys/resource.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 #include <sys/time.h> | 9 #include <sys/time.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 LinuxSandbox::LinuxSandbox() | 107 LinuxSandbox::LinuxSandbox() |
| 108 : proc_fd_(-1), | 108 : proc_fd_(-1), |
| 109 seccomp_bpf_started_(false), | 109 seccomp_bpf_started_(false), |
| 110 sandbox_status_flags_(kSandboxLinuxInvalid), | 110 sandbox_status_flags_(kSandboxLinuxInvalid), |
| 111 pre_initialized_(false), | 111 pre_initialized_(false), |
| 112 seccomp_bpf_supported_(false), | 112 seccomp_bpf_supported_(false), |
| 113 yama_is_enforcing_(false), | 113 yama_is_enforcing_(false), |
| 114 setuid_sandbox_client_(sandbox::SetuidSandboxClient::Create()) | 114 setuid_sandbox_client_(sandbox::SetuidSandboxClient::Create()) |
| 115 { | 115 { |
| 116 if (setuid_sandbox_client_ == NULL) { | 116 if (setuid_sandbox_client_ == nullptr) { |
| 117 LOG(FATAL) << "Failed to instantiate the setuid sandbox client."; | 117 LOG(FATAL) << "Failed to instantiate the setuid sandbox client."; |
| 118 } | 118 } |
| 119 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \ | 119 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \ |
| 120 defined(LEAK_SANITIZER) || defined(UNDEFINED_SANITIZER) | 120 defined(LEAK_SANITIZER) || defined(UNDEFINED_SANITIZER) |
| 121 sanitizer_args_ = make_scoped_ptr(new __sanitizer_sandbox_arguments); | 121 sanitizer_args_ = make_scoped_ptr(new __sanitizer_sandbox_arguments); |
| 122 *sanitizer_args_ = {0}; | 122 *sanitizer_args_ = {0}; |
| 123 #endif | 123 #endif |
| 124 } | 124 } |
| 125 | 125 |
| 126 LinuxSandbox::~LinuxSandbox() { | 126 LinuxSandbox::~LinuxSandbox() { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 void LinuxSandbox::StopThreadAndEnsureNotCounted(base::Thread* thread) const { | 406 void LinuxSandbox::StopThreadAndEnsureNotCounted(base::Thread* thread) const { |
| 407 DCHECK(thread); | 407 DCHECK(thread); |
| 408 base::ScopedFD proc_self_task(OpenProcTaskFd(proc_fd_)); | 408 base::ScopedFD proc_self_task(OpenProcTaskFd(proc_fd_)); |
| 409 PCHECK(proc_self_task.is_valid()); | 409 PCHECK(proc_self_task.is_valid()); |
| 410 CHECK(sandbox::ThreadHelpers::StopThreadAndWatchProcFS(proc_self_task.get(), | 410 CHECK(sandbox::ThreadHelpers::StopThreadAndWatchProcFS(proc_self_task.get(), |
| 411 thread)); | 411 thread)); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace content | 414 } // namespace content |
| OLD | NEW |