| OLD | NEW |
| 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 Loading... |
| 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. |
| OLD | NEW |