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 "content/common/sandbox_linux/bpf_utility_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_utility_policy_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/common/sandbox_linux/sandbox_linux.h" | 10 #include "content/common/sandbox_linux/sandbox_linux.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 UtilityProcessPolicy::~UtilityProcessPolicy() { | 25 UtilityProcessPolicy::~UtilityProcessPolicy() { |
26 } | 26 } |
27 | 27 |
28 ResultExpr UtilityProcessPolicy::EvaluateSyscall(int sysno) const { | 28 ResultExpr UtilityProcessPolicy::EvaluateSyscall(int sysno) const { |
29 switch (sysno) { | 29 switch (sysno) { |
30 case __NR_ioctl: | 30 case __NR_ioctl: |
31 return sandbox::RestrictIoctl(); | 31 return sandbox::RestrictIoctl(); |
32 // Allow the system calls below. | 32 // Allow the system calls below. |
33 case __NR_fdatasync: | 33 case __NR_fdatasync: |
34 case __NR_fsync: | 34 case __NR_fsync: |
35 #if defined(__i386__) || defined(__x86_64__) | 35 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ |
| 36 defined(__aarch64__) |
36 case __NR_getrlimit: | 37 case __NR_getrlimit: |
37 #endif | 38 #endif |
38 #if defined(__i386__) || defined(__arm__) | 39 #if defined(__i386__) || defined(__arm__) |
39 case __NR_ugetrlimit: | 40 case __NR_ugetrlimit: |
40 #endif | 41 #endif |
41 case __NR_mremap: // https://crbug.com/546204 | 42 case __NR_mremap: // https://crbug.com/546204 |
42 case __NR_pread64: | 43 case __NR_pread64: |
43 case __NR_pwrite64: | 44 case __NR_pwrite64: |
44 case __NR_sysinfo: | 45 case __NR_sysinfo: |
45 case __NR_times: | 46 case __NR_times: |
46 case __NR_uname: | 47 case __NR_uname: |
47 return Allow(); | 48 return Allow(); |
48 default: | 49 default: |
49 // Default on the content baseline policy. | 50 // Default on the content baseline policy. |
50 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); | 51 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); |
51 } | 52 } |
52 } | 53 } |
53 | 54 |
54 } // namespace content | 55 } // namespace content |
OLD | NEW |