| 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/android/sandbox_bpf_base_policy_android.h
" | 5 #include "content/common/sandbox_linux/android/sandbox_bpf_base_policy_android.h
" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/net.h> | 9 #include <linux/net.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 SandboxBPFBasePolicyAndroid::~SandboxBPFBasePolicyAndroid() {} | 55 SandboxBPFBasePolicyAndroid::~SandboxBPFBasePolicyAndroid() {} |
| 56 | 56 |
| 57 ResultExpr SandboxBPFBasePolicyAndroid::EvaluateSyscall(int sysno) const { | 57 ResultExpr SandboxBPFBasePolicyAndroid::EvaluateSyscall(int sysno) const { |
| 58 bool override_and_allow = false; | 58 bool override_and_allow = false; |
| 59 | 59 |
| 60 switch (sysno) { | 60 switch (sysno) { |
| 61 // TODO(rsesek): restrict clone parameters. | 61 // TODO(rsesek): restrict clone parameters. |
| 62 case __NR_clone: | 62 case __NR_clone: |
| 63 case __NR_epoll_pwait: | 63 case __NR_epoll_pwait: |
| 64 case __NR_flock: | 64 case __NR_flock: |
| 65 case __NR_ftruncate: |
| 66 #if defined(__i386__) || defined(__arm__) || defined(__mips__) |
| 67 case __NR_ftruncate64: |
| 68 #endif |
| 65 #if defined(__x86_64__) || defined(__aarch64__) | 69 #if defined(__x86_64__) || defined(__aarch64__) |
| 66 case __NR_newfstatat: | 70 case __NR_newfstatat: |
| 67 case __NR_getdents64: | 71 case __NR_getdents64: |
| 68 #elif defined(__i386__) || defined(__arm__) || defined(__mips__) | 72 #elif defined(__i386__) || defined(__arm__) || defined(__mips__) |
| 69 case __NR_fstatat64: | 73 case __NR_fstatat64: |
| 70 case __NR_getdents: | 74 case __NR_getdents: |
| 71 #endif | 75 #endif |
| 72 case __NR_getpriority: | 76 case __NR_getpriority: |
| 73 case __NR_ioctl: | 77 case __NR_ioctl: |
| 74 case __NR_mremap: | 78 case __NR_mremap: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 137 } |
| 134 #endif | 138 #endif |
| 135 | 139 |
| 136 if (override_and_allow) | 140 if (override_and_allow) |
| 137 return Allow(); | 141 return Allow(); |
| 138 | 142 |
| 139 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); | 143 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); |
| 140 } | 144 } |
| 141 | 145 |
| 142 } // namespace content | 146 } // namespace content |
| OLD | NEW |