| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_renderer_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_renderer_policy_linux.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <sys/ioctl.h> | 8 #include <sys/ioctl.h> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 switch (sysno) { | 53 switch (sysno) { |
| 54 // The baseline policy allows __NR_clock_gettime. Allow | 54 // The baseline policy allows __NR_clock_gettime. Allow |
| 55 // clock_getres() for V8. crbug.com/329053. | 55 // clock_getres() for V8. crbug.com/329053. |
| 56 case __NR_clock_getres: | 56 case __NR_clock_getres: |
| 57 return sandbox::RestrictClockID(); | 57 return sandbox::RestrictClockID(); |
| 58 case __NR_ioctl: | 58 case __NR_ioctl: |
| 59 return RestrictIoctl(); | 59 return RestrictIoctl(); |
| 60 // Allow the system calls below. | 60 // Allow the system calls below. |
| 61 case __NR_fdatasync: | 61 case __NR_fdatasync: |
| 62 case __NR_fsync: | 62 case __NR_fsync: |
| 63 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) | 63 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ |
| 64 defined(__aarch64__) |
| 64 case __NR_getrlimit: | 65 case __NR_getrlimit: |
| 65 #endif | 66 #endif |
| 66 #if defined(__i386__) || defined(__arm__) | 67 #if defined(__i386__) || defined(__arm__) |
| 67 case __NR_ugetrlimit: | 68 case __NR_ugetrlimit: |
| 68 #endif | 69 #endif |
| 69 case __NR_mremap: // See crbug.com/149834. | 70 case __NR_mremap: // See crbug.com/149834. |
| 70 case __NR_pread64: | 71 case __NR_pread64: |
| 71 case __NR_pwrite64: | 72 case __NR_pwrite64: |
| 72 case __NR_sched_get_priority_max: | 73 case __NR_sched_get_priority_max: |
| 73 case __NR_sched_get_priority_min: | 74 case __NR_sched_get_priority_min: |
| 74 case __NR_sysinfo: | 75 case __NR_sysinfo: |
| 75 case __NR_times: | 76 case __NR_times: |
| 76 case __NR_uname: | 77 case __NR_uname: |
| 77 return Allow(); | 78 return Allow(); |
| 78 case __NR_sched_getaffinity: | 79 case __NR_sched_getaffinity: |
| 79 case __NR_sched_getparam: | 80 case __NR_sched_getparam: |
| 80 case __NR_sched_getscheduler: | 81 case __NR_sched_getscheduler: |
| 81 case __NR_sched_setscheduler: | 82 case __NR_sched_setscheduler: |
| 82 return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno); | 83 return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno); |
| 83 case __NR_prlimit64: | 84 case __NR_prlimit64: |
| 84 return Error(EPERM); // See crbug.com/160157. | 85 return Error(EPERM); // See crbug.com/160157. |
| 85 default: | 86 default: |
| 86 // Default on the content baseline policy. | 87 // Default on the content baseline policy. |
| 87 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); | 88 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); |
| 88 } | 89 } |
| 89 } | 90 } |
| 90 | 91 |
| 91 } // namespace content | 92 } // namespace content |
| OLD | NEW |