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 "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 5 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <sys/prctl.h> | 9 #include <sys/prctl.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
11 #include <unistd.h> | 11 #include <unistd.h> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/scoped_file.h" | 14 #include "base/files/scoped_file.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "base/posix/eintr_wrapper.h" | 17 #include "base/posix/eintr_wrapper.h" |
19 #include "base/third_party/valgrind/valgrind.h" | 18 #include "base/third_party/valgrind/valgrind.h" |
20 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" | 19 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" |
21 #include "sandbox/linux/bpf_dsl/codegen.h" | 20 #include "sandbox/linux/bpf_dsl/codegen.h" |
22 #include "sandbox/linux/bpf_dsl/policy.h" | 21 #include "sandbox/linux/bpf_dsl/policy.h" |
23 #include "sandbox/linux/bpf_dsl/policy_compiler.h" | 22 #include "sandbox/linux/bpf_dsl/policy_compiler.h" |
24 #include "sandbox/linux/bpf_dsl/seccomp_macros.h" | 23 #include "sandbox/linux/bpf_dsl/seccomp_macros.h" |
25 #include "sandbox/linux/bpf_dsl/syscall_set.h" | 24 #include "sandbox/linux/bpf_dsl/syscall_set.h" |
26 #include "sandbox/linux/seccomp-bpf/die.h" | 25 #include "sandbox/linux/seccomp-bpf/die.h" |
27 #include "sandbox/linux/seccomp-bpf/syscall.h" | 26 #include "sandbox/linux/seccomp-bpf/syscall.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } else { | 270 } else { |
272 if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) { | 271 if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) { |
273 SANDBOX_DIE("Kernel refuses to turn on BPF filters"); | 272 SANDBOX_DIE("Kernel refuses to turn on BPF filters"); |
274 } | 273 } |
275 } | 274 } |
276 | 275 |
277 sandbox_has_started_ = true; | 276 sandbox_has_started_ = true; |
278 } | 277 } |
279 | 278 |
280 } // namespace sandbox | 279 } // namespace sandbox |
OLD | NEW |