OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/shell/runner/host/linux_sandbox.h" | 5 #include "mojo/shell/runner/host/linux_sandbox.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/syscall.h> | 8 #include <sys/syscall.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 case __NR_ftruncate: | 87 case __NR_ftruncate: |
88 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) | 88 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) |
89 // Per #ifdefs in | 89 // Per #ifdefs in |
90 // content/common/sandbox_linux/bpf_renderer_policy_linux.cc | 90 // content/common/sandbox_linux/bpf_renderer_policy_linux.cc |
91 case __NR_getrlimit: | 91 case __NR_getrlimit: |
92 #endif | 92 #endif |
93 #if defined(__i386__) || defined(__arm__) | 93 #if defined(__i386__) || defined(__arm__) |
94 case __NR_ugetrlimit: | 94 case __NR_ugetrlimit: |
95 #endif | 95 #endif |
96 case __NR_uname: | 96 case __NR_uname: |
| 97 #if defined(__arm__) || defined(__x86_64__) || defined(__mips__) |
97 case __NR_getsockopt: | 98 case __NR_getsockopt: |
98 case __NR_setsockopt: | 99 case __NR_setsockopt: |
| 100 #endif |
99 return sandbox::bpf_dsl::Allow(); | 101 return sandbox::bpf_dsl::Allow(); |
100 } | 102 } |
101 | 103 |
102 return BaselinePolicy::EvaluateSyscall(sysno); | 104 return BaselinePolicy::EvaluateSyscall(sysno); |
103 } | 105 } |
104 | 106 |
105 private: | 107 private: |
106 // Not owned. | 108 // Not owned. |
107 const sandbox::syscall_broker::BrokerProcess* broker_process_; | 109 const sandbox::syscall_broker::BrokerProcess* broker_process_; |
108 DISALLOW_COPY_AND_ASSIGN(SandboxPolicy); | 110 DISALLOW_COPY_AND_ASSIGN(SandboxPolicy); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 ALLOW_UNUSED_LOCAL(leaked_broker); | 157 ALLOW_UNUSED_LOCAL(leaked_broker); |
156 ANNOTATE_LEAKING_OBJECT_PTR(leaked_broker); | 158 ANNOTATE_LEAKING_OBJECT_PTR(leaked_broker); |
157 } | 159 } |
158 | 160 |
159 void LinuxSandbox::Seal() { | 161 void LinuxSandbox::Seal() { |
160 proc_fd_.reset(); | 162 proc_fd_.reset(); |
161 } | 163 } |
162 | 164 |
163 } // namespace shell | 165 } // namespace shell |
164 } // namespace mojo | 166 } // namespace mojo |
OLD | NEW |