OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/nacl/loader/nonsfi/nonsfi_sandbox.h" | 5 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <linux/futex.h> | 9 #include <linux/futex.h> |
10 #include <linux/net.h> | 10 #include <linux/net.h> |
11 #include <sys/mman.h> | 11 #include <sys/mman.h> |
12 #include <sys/prctl.h> | 12 #include <sys/prctl.h> |
13 #include <sys/ptrace.h> | 13 #include <sys/ptrace.h> |
14 #include <sys/socket.h> | 14 #include <sys/socket.h> |
15 #include <sys/syscall.h> | 15 #include <sys/syscall.h> |
16 #include <sys/time.h> | 16 #include <sys/time.h> |
17 | 17 |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "content/public/common/sandbox_init.h" | 22 #include "content/public/common/sandbox_init.h" |
23 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" | 23 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" |
24 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | 24 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" |
25 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" | 25 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" |
26 #include "sandbox/linux/services/linux_syscalls.h" | 26 #include "sandbox/linux/system_headers/linux_syscalls.h" |
27 | 27 |
28 #if defined(__arm__) && !defined(MAP_STACK) | 28 #if defined(__arm__) && !defined(MAP_STACK) |
29 // Chrome OS Daisy (ARM) build environment has old headers. | 29 // Chrome OS Daisy (ARM) build environment has old headers. |
30 #define MAP_STACK 0x20000 | 30 #define MAP_STACK 0x20000 |
31 #endif | 31 #endif |
32 | 32 |
33 #define CASES SANDBOX_BPF_DSL_CASES | 33 #define CASES SANDBOX_BPF_DSL_CASES |
34 | 34 |
35 using sandbox::CrashSIGSYS; | 35 using sandbox::CrashSIGSYS; |
36 using sandbox::CrashSIGSYSClone; | 36 using sandbox::CrashSIGSYSClone; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 new nacl::nonsfi::NaClNonSfiBPFSandboxPolicy()), | 306 new nacl::nonsfi::NaClNonSfiBPFSandboxPolicy()), |
307 proc_task_fd.Pass()); | 307 proc_task_fd.Pass()); |
308 if (!sandbox_is_initialized) | 308 if (!sandbox_is_initialized) |
309 return false; | 309 return false; |
310 RunSandboxSanityChecks(); | 310 RunSandboxSanityChecks(); |
311 return true; | 311 return true; |
312 } | 312 } |
313 | 313 |
314 } // namespace nonsfi | 314 } // namespace nonsfi |
315 } // namespace nacl | 315 } // namespace nacl |
OLD | NEW |