| 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 #ifndef CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_LINUX_H_ | 5 #ifndef CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_LINUX_H_ |
| 6 #define CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_LINUX_H_ | 6 #define CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_LINUX_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 DCHECK_NE(-1, proc_fd_); | 132 DCHECK_NE(-1, proc_fd_); |
| 133 return proc_fd_; | 133 return proc_fd_; |
| 134 } | 134 } |
| 135 | 135 |
| 136 #if defined(ANY_OF_AMTLU_SANITIZER) | 136 #if defined(ANY_OF_AMTLU_SANITIZER) |
| 137 __sanitizer_sandbox_arguments* sanitizer_args() const { | 137 __sanitizer_sandbox_arguments* sanitizer_args() const { |
| 138 return sanitizer_args_.get(); | 138 return sanitizer_args_.get(); |
| 139 }; | 139 }; |
| 140 #endif | 140 #endif |
| 141 | 141 |
| 142 void set_exiting_before_initialize_sandbox(bool exiting) { |
| 143 exiting_before_initialize_sandbox_ = exiting; |
| 144 } |
| 145 |
| 142 private: | 146 private: |
| 143 friend struct base::DefaultSingletonTraits<LinuxSandbox>; | 147 friend struct base::DefaultSingletonTraits<LinuxSandbox>; |
| 144 | 148 |
| 145 LinuxSandbox(); | 149 LinuxSandbox(); |
| 146 ~LinuxSandbox(); | 150 ~LinuxSandbox(); |
| 147 | 151 |
| 148 // Some methods are static and get an instance of the Singleton. These | 152 // Some methods are static and get an instance of the Singleton. These |
| 149 // are the non-static implementations. | 153 // are the non-static implementations. |
| 150 bool InitializeSandboxImpl(); | 154 bool InitializeSandboxImpl(); |
| 151 void StopThreadImpl(base::Thread* thread); | 155 void StopThreadImpl(base::Thread* thread); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 172 int proc_fd_; | 176 int proc_fd_; |
| 173 bool seccomp_bpf_started_; | 177 bool seccomp_bpf_started_; |
| 174 // The value returned by GetStatus(). Gets computed once and then cached. | 178 // The value returned by GetStatus(). Gets computed once and then cached. |
| 175 int sandbox_status_flags_; | 179 int sandbox_status_flags_; |
| 176 // Did PreinitializeSandbox() run? | 180 // Did PreinitializeSandbox() run? |
| 177 bool pre_initialized_; | 181 bool pre_initialized_; |
| 178 bool seccomp_bpf_supported_; // Accurate if pre_initialized_. | 182 bool seccomp_bpf_supported_; // Accurate if pre_initialized_. |
| 179 bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_. | 183 bool seccomp_bpf_with_tsync_supported_; // Accurate if pre_initialized_. |
| 180 bool yama_is_enforcing_; // Accurate if pre_initialized_. | 184 bool yama_is_enforcing_; // Accurate if pre_initialized_. |
| 181 bool initialize_sandbox_ran_; // InitializeSandbox() was called. | 185 bool initialize_sandbox_ran_; // InitializeSandbox() was called. |
| 186 // Set when exiting due to error during startup. Allows shutdown to happen |
| 187 // without verifying that InitializeSandbox() was called. |
| 188 bool exiting_before_initialize_sandbox_; |
| 182 std::unique_ptr<sandbox::SetuidSandboxClient> setuid_sandbox_client_; | 189 std::unique_ptr<sandbox::SetuidSandboxClient> setuid_sandbox_client_; |
| 183 #if defined(ANY_OF_AMTLU_SANITIZER) | 190 #if defined(ANY_OF_AMTLU_SANITIZER) |
| 184 std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_; | 191 std::unique_ptr<__sanitizer_sandbox_arguments> sanitizer_args_; |
| 185 #endif | 192 #endif |
| 186 | 193 |
| 187 DISALLOW_COPY_AND_ASSIGN(LinuxSandbox); | 194 DISALLOW_COPY_AND_ASSIGN(LinuxSandbox); |
| 188 }; | 195 }; |
| 189 | 196 |
| 190 } // namespace content | 197 } // namespace content |
| 191 | 198 |
| 192 #endif // CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_LINUX_H_ | 199 #endif // CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_LINUX_H_ |
| OLD | NEW |