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

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc

Issue 258073008: Linux sandbox: restrict *kill to the current process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One nit disappeared :) Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ('k') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h" 5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "sandbox/linux/services/linux_syscalls.h" 8 #include "sandbox/linux/services/linux_syscalls.h"
9 9
10 namespace sandbox { 10 namespace sandbox {
11 11
12 // The functions below cover all existing i386, x86_64, and ARM system calls; 12 // The functions below cover all existing i386, x86_64, and ARM system calls;
13 // excluding syscalls made obsolete in ARM EABI. 13 // excluding syscalls made obsolete in ARM EABI.
14 // The implicitly defined sets form a partition of the sets of 14 // The implicitly defined sets form a partition of the sets of
15 // system calls. 15 // system calls.
16 16
17 // TODO(jln) we need to restrict the first parameter!
18 bool SyscallSets::IsKill(int sysno) { 17 bool SyscallSets::IsKill(int sysno) {
19 switch (sysno) { 18 switch (sysno) {
20 case __NR_kill: 19 case __NR_kill:
21 case __NR_tkill:
22 case __NR_tgkill: 20 case __NR_tgkill:
21 case __NR_tkill: // Deprecated.
23 return true; 22 return true;
24 default: 23 default:
25 return false; 24 return false;
26 } 25 }
27 } 26 }
28 27
29 bool SyscallSets::IsAllowedGettime(int sysno) { 28 bool SyscallSets::IsAllowedGettime(int sysno) {
30 switch (sysno) { 29 switch (sysno) {
31 case __NR_clock_gettime: 30 case __NR_clock_gettime:
32 case __NR_gettimeofday: 31 case __NR_gettimeofday:
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 case __ARM_NR_usr26: 971 case __ARM_NR_usr26:
973 case __ARM_NR_usr32: 972 case __ARM_NR_usr32:
974 return true; 973 return true;
975 default: 974 default:
976 return false; 975 return false;
977 } 976 }
978 } 977 }
979 #endif // defined(__arm__) 978 #endif // defined(__arm__)
980 979
981 } // namespace sandbox. 980 } // namespace sandbox.
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698