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

Side by Side Diff: content/common/sandbox_linux/bpf_renderer_policy_linux.cc

Issue 260793003: [MIPS] Add seccomp bpf support (Closed) Base URL: https://git.chromium.org/git/chromium/src.git@master
Patch Set: Update per code review Created 6 years, 5 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
OLDNEW
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 "content/common/sandbox_linux/bpf_renderer_policy_linux.h" 5 #include "content/common/sandbox_linux/bpf_renderer_policy_linux.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 15 matching lines...) Expand all
26 switch (sysno) { 26 switch (sysno) {
27 case __NR_ioctl: 27 case __NR_ioctl:
28 return sandbox::RestrictIoctl(sandbox); 28 return sandbox::RestrictIoctl(sandbox);
29 // Allow the system calls below. 29 // Allow the system calls below.
30 // The baseline policy allows __NR_clock_gettime. Allow 30 // The baseline policy allows __NR_clock_gettime. Allow
31 // clock_getres() for V8. crbug.com/329053. 31 // clock_getres() for V8. crbug.com/329053.
32 case __NR_clock_getres: 32 case __NR_clock_getres:
33 case __NR_fdatasync: 33 case __NR_fdatasync:
34 case __NR_fsync: 34 case __NR_fsync:
35 case __NR_getpriority: 35 case __NR_getpriority:
36 #if defined(__i386__) || defined(__x86_64__) 36 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
37 case __NR_getrlimit: 37 case __NR_getrlimit:
38 #endif 38 #endif
39 #if defined(__i386__) || defined(__arm__) 39 #if defined(__i386__) || defined(__arm__)
40 case __NR_ugetrlimit: 40 case __NR_ugetrlimit:
41 #endif 41 #endif
42 case __NR_mremap: // See crbug.com/149834. 42 case __NR_mremap: // See crbug.com/149834.
43 case __NR_pread64: 43 case __NR_pread64:
44 case __NR_pwrite64: 44 case __NR_pwrite64:
45 case __NR_sched_getaffinity: 45 case __NR_sched_getaffinity:
46 case __NR_sched_get_priority_max: 46 case __NR_sched_get_priority_max:
47 case __NR_sched_get_priority_min: 47 case __NR_sched_get_priority_min:
48 case __NR_sched_getparam: 48 case __NR_sched_getparam:
49 case __NR_sched_getscheduler: 49 case __NR_sched_getscheduler:
50 case __NR_sched_setscheduler: 50 case __NR_sched_setscheduler:
51 case __NR_setpriority: 51 case __NR_setpriority:
52 case __NR_sysinfo: 52 case __NR_sysinfo:
53 case __NR_times: 53 case __NR_times:
54 case __NR_uname: 54 case __NR_uname:
55 return ErrorCode(ErrorCode::ERR_ALLOWED); 55 return ErrorCode(ErrorCode::ERR_ALLOWED);
56 case __NR_prlimit64: 56 case __NR_prlimit64:
57 return ErrorCode(EPERM); // See crbug.com/160157. 57 return ErrorCode(EPERM); // See crbug.com/160157.
58 default: 58 default:
59 // Default on the content baseline policy. 59 // Default on the content baseline policy.
60 return SandboxBPFBasePolicy::EvaluateSyscall(sandbox, sysno); 60 return SandboxBPFBasePolicy::EvaluateSyscall(sandbox, sysno);
61 } 61 }
62 } 62 }
63 63
64 } // namespace content 64 } // namespace content
OLDNEW
« no previous file with comments | « content/common/sandbox_linux/bpf_gpu_policy_linux.cc ('k') | content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698