Chromium Code Reviews| 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 "components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.h" | 5 #include "components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 } | 99 } |
| 100 | 100 |
| 101 switch (sysno) { | 101 switch (sysno) { |
| 102 #if defined(__i386__) || defined(__mips__) | 102 #if defined(__i386__) || defined(__mips__) |
| 103 // Needed on i386 to set-up the custom segments. | 103 // Needed on i386 to set-up the custom segments. |
| 104 case __NR_modify_ldt: | 104 case __NR_modify_ldt: |
| 105 #endif | 105 #endif |
| 106 // NaCl uses custom signal stacks. | 106 // NaCl uses custom signal stacks. |
| 107 case __NR_sigaltstack: | 107 case __NR_sigaltstack: |
| 108 // Below is fairly similar to the policy for a Chromium renderer. | 108 // Below is fairly similar to the policy for a Chromium renderer. |
| 109 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) | 109 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ |
| 110 defined(__aarch64__) | |
|
Mark Seaborn
2016/02/26 20:25:30
This implies that we support running this NaCl cod
| |
| 110 case __NR_getrlimit: | 111 case __NR_getrlimit: |
| 111 #endif | 112 #endif |
| 112 #if defined(__i386__) || defined(__arm__) | 113 #if defined(__i386__) || defined(__arm__) |
| 113 case __NR_ugetrlimit: | 114 case __NR_ugetrlimit: |
| 114 #endif | 115 #endif |
| 115 // NaCl runtime uses flock to simulate POSIX behavior for pwrite. | 116 // NaCl runtime uses flock to simulate POSIX behavior for pwrite. |
| 116 case __NR_flock: | 117 case __NR_flock: |
| 117 case __NR_pread64: | 118 case __NR_pread64: |
| 118 case __NR_pwrite64: | 119 case __NR_pwrite64: |
| 119 case __NR_sched_get_priority_max: | 120 case __NR_sched_get_priority_max: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 std::move(proc_fd)); | 172 std::move(proc_fd)); |
| 172 if (sandbox_is_initialized) { | 173 if (sandbox_is_initialized) { |
| 173 RunSandboxSanityChecks(); | 174 RunSandboxSanityChecks(); |
| 174 return true; | 175 return true; |
| 175 } | 176 } |
| 176 #endif // defined(USE_SECCOMP_BPF) | 177 #endif // defined(USE_SECCOMP_BPF) |
| 177 return false; | 178 return false; |
| 178 } | 179 } |
| 179 | 180 |
| 180 } // namespace nacl | 181 } // namespace nacl |
| OLD | NEW |