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

Side by Side Diff: content/common/sandbox_seccomp_bpf_linux.cc

Issue 11140038: Re-enable Seccomp-BPF on ARM. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <asm/unistd.h> 5 #include <asm/unistd.h>
6 #include <dlfcn.h> 6 #include <dlfcn.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/audit.h> 9 #include <linux/audit.h>
10 #include <linux/filter.h> 10 #include <linux/filter.h>
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 !command_line.HasSwitch(switches::kDisableSeccompFilterSandbox)) { 1401 !command_line.HasSwitch(switches::kDisableSeccompFilterSandbox)) {
1402 return true; 1402 return true;
1403 } else { 1403 } else {
1404 return false; 1404 return false;
1405 } 1405 }
1406 } 1406 }
1407 1407
1408 bool SandboxSeccompBpf::ShouldEnableSeccompBpf( 1408 bool SandboxSeccompBpf::ShouldEnableSeccompBpf(
1409 const std::string& process_type) { 1409 const std::string& process_type) {
1410 #if defined(SECCOMP_BPF_SANDBOX) 1410 #if defined(SECCOMP_BPF_SANDBOX)
1411 #if defined(__arm__)
1412 // We disable the sandbox on ARM for now until crbug.com/148856 is fixed.
1413 return false;
1414 #else
1415 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1411 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1416 if (process_type == switches::kGpuProcess) 1412 if (process_type == switches::kGpuProcess)
1417 return !command_line.HasSwitch(switches::kDisableGpuSandbox); 1413 return !command_line.HasSwitch(switches::kDisableGpuSandbox);
1418 1414
1419 return true; 1415 return true;
1420 #endif // __arm__
1421 #endif // SECCOMP_BPF_SANDBOX 1416 #endif // SECCOMP_BPF_SANDBOX
1422 return false; 1417 return false;
1423 } 1418 }
1424 1419
1425 bool SandboxSeccompBpf::SupportsSandbox() { 1420 bool SandboxSeccompBpf::SupportsSandbox() {
1426 #if defined(SECCOMP_BPF_SANDBOX) 1421 #if defined(SECCOMP_BPF_SANDBOX)
1427 // TODO(jln): pass the saved proc_fd_ from the LinuxSandbox singleton 1422 // TODO(jln): pass the saved proc_fd_ from the LinuxSandbox singleton
1428 // here. 1423 // here.
1429 if (Sandbox::supportsSeccompSandbox(-1) == 1424 if (Sandbox::supportsSeccompSandbox(-1) ==
1430 Sandbox::STATUS_AVAILABLE) { 1425 Sandbox::STATUS_AVAILABLE) {
(...skipping 11 matching lines...) Expand all
1442 // Process-specific policy. 1437 // Process-specific policy.
1443 ShouldEnableSeccompBpf(process_type) && 1438 ShouldEnableSeccompBpf(process_type) &&
1444 SupportsSandbox()) { 1439 SupportsSandbox()) {
1445 return StartBpfSandbox(command_line, process_type); 1440 return StartBpfSandbox(command_line, process_type);
1446 } 1441 }
1447 #endif 1442 #endif
1448 return false; 1443 return false;
1449 } 1444 }
1450 1445
1451 } // namespace content 1446 } // namespace content
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