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/common/sandbox_linux/sandbox_seccomp_bpf_linux.h" | 5 #include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 35 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
36 #include "sandbox/linux/services/linux_syscalls.h" | 36 #include "sandbox/linux/services/linux_syscalls.h" |
37 | 37 |
38 using sandbox::BaselinePolicy; | 38 using sandbox::BaselinePolicy; |
39 using sandbox::SyscallSets; | 39 using sandbox::SyscallSets; |
40 | 40 |
41 #else | 41 #else |
42 | 42 |
43 // Make sure that seccomp-bpf does not get disabled by mistake. Also make sure | 43 // Make sure that seccomp-bpf does not get disabled by mistake. Also make sure |
44 // that we think twice about this when adding a new architecture. | 44 // that we think twice about this when adding a new architecture. |
45 #if !defined(ARCH_CPU_MIPS_FAMILY) && !defined(ARCH_CPU_ARM64) | 45 #if !defined(ARCH_CPU_ARM64) |
46 #error "Seccomp-bpf disabled on supported architecture!" | 46 #error "Seccomp-bpf disabled on supported architecture!" |
47 #endif // !defined(ARCH_CPU_MIPS_FAMILY) && !defined(ARCH_CPU_ARM64) | 47 #endif // !defined(ARCH_CPU_ARM64) |
48 | 48 |
49 #endif // | 49 #endif // |
50 | 50 |
51 namespace content { | 51 namespace content { |
52 | 52 |
53 #if defined(USE_SECCOMP_BPF) | 53 #if defined(USE_SECCOMP_BPF) |
54 namespace { | 54 namespace { |
55 | 55 |
56 void StartSandboxWithPolicy(sandbox::SandboxBPFPolicy* policy); | 56 void StartSandboxWithPolicy(sandbox::SandboxBPFPolicy* policy); |
57 | 57 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 scoped_ptr<sandbox::SandboxBPFPolicy> | 294 scoped_ptr<sandbox::SandboxBPFPolicy> |
295 SandboxSeccompBPF::GetBaselinePolicy() { | 295 SandboxSeccompBPF::GetBaselinePolicy() { |
296 #if defined(USE_SECCOMP_BPF) | 296 #if defined(USE_SECCOMP_BPF) |
297 return scoped_ptr<sandbox::SandboxBPFPolicy>(new BaselinePolicy); | 297 return scoped_ptr<sandbox::SandboxBPFPolicy>(new BaselinePolicy); |
298 #else | 298 #else |
299 return scoped_ptr<sandbox::SandboxBPFPolicy>(); | 299 return scoped_ptr<sandbox::SandboxBPFPolicy>(); |
300 #endif // defined(USE_SECCOMP_BPF) | 300 #endif // defined(USE_SECCOMP_BPF) |
301 } | 301 } |
302 | 302 |
303 } // namespace content | 303 } // namespace content |
OLD | NEW |