| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #if defined(__x86_64__) || defined(__aarch64__) | 71 #if defined(__x86_64__) || defined(__aarch64__) |
| 72 case __NR_newfstatat: | 72 case __NR_newfstatat: |
| 73 case __NR_getdents64: | 73 case __NR_getdents64: |
| 74 #elif defined(__i386__) || defined(__arm__) || defined(__mips__) | 74 #elif defined(__i386__) || defined(__arm__) || defined(__mips__) |
| 75 case __NR_fstatat64: | 75 case __NR_fstatat64: |
| 76 case __NR_getdents: | 76 case __NR_getdents: |
| 77 #endif | 77 #endif |
| 78 case __NR_getpriority: | 78 case __NR_getpriority: |
| 79 case __NR_ioctl: | 79 case __NR_ioctl: |
| 80 case __NR_mremap: | 80 case __NR_mremap: |
| 81 case __NR_msync: |
| 81 // File system access cannot be restricted with seccomp-bpf on Android, | 82 // File system access cannot be restricted with seccomp-bpf on Android, |
| 82 // since the JVM classloader and other Framework features require file | 83 // since the JVM classloader and other Framework features require file |
| 83 // access. It may be possible to restrict the filesystem with SELinux. | 84 // access. It may be possible to restrict the filesystem with SELinux. |
| 84 // Currently we rely on the app/service UID isolation to create a | 85 // Currently we rely on the app/service UID isolation to create a |
| 85 // filesystem "sandbox". | 86 // filesystem "sandbox". |
| 86 #if !defined(ARCH_CPU_ARM64) | 87 #if !defined(ARCH_CPU_ARM64) |
| 87 case __NR_open: | 88 case __NR_open: |
| 88 #endif | 89 #endif |
| 89 case __NR_openat: | 90 case __NR_openat: |
| 90 case __NR_pread64: | 91 case __NR_pread64: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 146 } |
| 146 #endif | 147 #endif |
| 147 | 148 |
| 148 if (override_and_allow) | 149 if (override_and_allow) |
| 149 return Allow(); | 150 return Allow(); |
| 150 | 151 |
| 151 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); | 152 return SandboxBPFBasePolicy::EvaluateSyscall(sysno); |
| 152 } | 153 } |
| 153 | 154 |
| 154 } // namespace content | 155 } // namespace content |
| OLD | NEW |