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 <asm/unistd.h> | 5 #include <asm/unistd.h> |
6 #include <dlfcn.h> | 6 #include <dlfcn.h> |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <linux/audit.h> | 9 #include <linux/audit.h> |
10 #include <linux/filter.h> | 10 #include <linux/filter.h> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 | 26 |
27 // These are the only architectures supported for now. | 27 // These are the only architectures supported for now. |
28 #if defined(__i386__) || defined(__x86_64__) || \ | 28 #if defined(__i386__) || defined(__x86_64__) || \ |
29 (defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__))) | 29 (defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__))) |
30 #define SECCOMP_BPF_SANDBOX | 30 #define SECCOMP_BPF_SANDBOX |
31 #endif | 31 #endif |
32 | 32 |
33 #if defined(SECCOMP_BPF_SANDBOX) | 33 #if defined(SECCOMP_BPF_SANDBOX) |
34 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 34 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
35 | 35 #include "sandbox/linux/services/linux_syscalls.h" |
36 #if defined(__i386__) || defined(__x86_64__) | |
37 #include "sandbox/linux/services/x86_linux_syscalls.h" | |
38 #elif defined(__arm__) | |
39 // This file doesn't yet list all syscalls. | |
40 #include "sandbox/linux/services/arm_linux_syscalls.h" | |
41 #endif | |
42 | 36 |
43 namespace { | 37 namespace { |
44 | 38 |
45 inline bool IsChromeOS() { | 39 inline bool IsChromeOS() { |
46 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
47 return true; | 41 return true; |
48 #else | 42 #else |
49 return false; | 43 return false; |
50 #endif | 44 #endif |
51 } | 45 } |
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 // Process-specific policy. | 1412 // Process-specific policy. |
1419 ShouldEnableSeccompBpf(process_type) && | 1413 ShouldEnableSeccompBpf(process_type) && |
1420 SupportsSandbox()) { | 1414 SupportsSandbox()) { |
1421 return StartBpfSandbox(command_line, process_type); | 1415 return StartBpfSandbox(command_line, process_type); |
1422 } | 1416 } |
1423 #endif | 1417 #endif |
1424 return false; | 1418 return false; |
1425 } | 1419 } |
1426 | 1420 |
1427 } // namespace content | 1421 } // namespace content |
OLD | NEW |