Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: services/shell/runner/host/linux_sandbox.cc

Issue 2033733002: shell linux_sandbox: fix SandboxSIGSYSHandler on arm64 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/shell/runner/host/linux_sandbox.h" 5 #include "services/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 20 matching lines...) Expand all
31 namespace shell { 31 namespace shell {
32 32
33 namespace { 33 namespace {
34 34
35 intptr_t SandboxSIGSYSHandler(const struct sandbox::arch_seccomp_data& args, 35 intptr_t SandboxSIGSYSHandler(const struct sandbox::arch_seccomp_data& args,
36 void* aux) { 36 void* aux) {
37 RAW_CHECK(aux); 37 RAW_CHECK(aux);
38 const sandbox::syscall_broker::BrokerProcess* broker_process = 38 const sandbox::syscall_broker::BrokerProcess* broker_process =
39 static_cast<const sandbox::syscall_broker::BrokerProcess*>(aux); 39 static_cast<const sandbox::syscall_broker::BrokerProcess*>(aux);
40 switch (args.nr) { 40 switch (args.nr) {
41 #if defined(__NR_access)
41 case __NR_access: 42 case __NR_access:
42 return broker_process->Access(reinterpret_cast<const char*>(args.args[0]), 43 return broker_process->Access(reinterpret_cast<const char*>(args.args[0]),
43 static_cast<int>(args.args[1])); 44 static_cast<int>(args.args[1]));
45 #endif
46 #if defined(__NR_open)
44 case __NR_open: 47 case __NR_open:
45 return broker_process->Open(reinterpret_cast<const char*>(args.args[0]), 48 return broker_process->Open(reinterpret_cast<const char*>(args.args[0]),
46 static_cast<int>(args.args[1])); 49 static_cast<int>(args.args[1]));
50 #endif
47 case __NR_faccessat: 51 case __NR_faccessat:
48 if (static_cast<int>(args.args[0]) == AT_FDCWD) { 52 if (static_cast<int>(args.args[0]) == AT_FDCWD) {
49 return broker_process->Access( 53 return broker_process->Access(
50 reinterpret_cast<const char*>(args.args[1]), 54 reinterpret_cast<const char*>(args.args[1]),
51 static_cast<int>(args.args[2])); 55 static_cast<int>(args.args[2]));
52 } else { 56 } else {
53 return -EPERM; 57 return -EPERM;
54 } 58 }
55 case __NR_openat: 59 case __NR_openat:
56 // Allow using openat() as open(). 60 // Allow using openat() as open().
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 sandbox::syscall_broker::BrokerProcess* leaked_broker = broker_.release(); 162 sandbox::syscall_broker::BrokerProcess* leaked_broker = broker_.release();
159 ALLOW_UNUSED_LOCAL(leaked_broker); 163 ALLOW_UNUSED_LOCAL(leaked_broker);
160 ANNOTATE_LEAKING_OBJECT_PTR(leaked_broker); 164 ANNOTATE_LEAKING_OBJECT_PTR(leaked_broker);
161 } 165 }
162 166
163 void LinuxSandbox::Seal() { 167 void LinuxSandbox::Seal() {
164 proc_fd_.reset(); 168 proc_fd_.reset();
165 } 169 }
166 170
167 } // namespace shell 171 } // namespace shell
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698