| 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 case __NR_fsync: | 36 case __NR_fsync: |
| 37 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) | 37 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) |
| 38 case __NR_getrlimit: | 38 case __NR_getrlimit: |
| 39 #endif | 39 #endif |
| 40 #if defined(__i386__) || defined(__arm__) | 40 #if defined(__i386__) || defined(__arm__) |
| 41 case __NR_ugetrlimit: | 41 case __NR_ugetrlimit: |
| 42 #endif | 42 #endif |
| 43 case __NR_mremap: // See crbug.com/149834. | 43 case __NR_mremap: // See crbug.com/149834. |
| 44 case __NR_pread64: | 44 case __NR_pread64: |
| 45 case __NR_pwrite64: | 45 case __NR_pwrite64: |
| 46 case __NR_sched_getaffinity: | |
| 47 case __NR_sched_get_priority_max: | 46 case __NR_sched_get_priority_max: |
| 48 case __NR_sched_get_priority_min: | 47 case __NR_sched_get_priority_min: |
| 49 case __NR_sched_getparam: | |
| 50 case __NR_sched_getscheduler: | |
| 51 case __NR_sched_setscheduler: | |
| 52 case __NR_sysinfo: | 48 case __NR_sysinfo: |
| 53 case __NR_times: | 49 case __NR_times: |
| 54 case __NR_uname: | 50 case __NR_uname: |
| 55 return Allow(); | 51 return Allow(); |
| 52 case __NR_sched_getaffinity: |
| 53 case __NR_sched_getparam: |
| 54 case __NR_sched_getscheduler: |
| 55 case __NR_sched_setscheduler: |
| 56 return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno); |
| 56 case __NR_prlimit64: | 57 case __NR_prlimit64: |
| 57 return Error(EPERM); // See crbug.com/160157. | 58 return Error(EPERM); // See crbug.com/160157. |
| 58 default: | 59 default: |
| 59 // Default on the content baseline policy. | 60 // Default on the content baseline policy. |
| 60 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); | 61 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 | 64 |
| 64 } // namespace content | 65 } // namespace content |
| OLD | NEW |