diff options
Diffstat (limited to 'sandbox/linux/seccomp-bpf/syscall_iterator.cc')
-rw-r--r-- | sandbox/linux/seccomp-bpf/syscall_iterator.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sandbox/linux/seccomp-bpf/syscall_iterator.cc b/sandbox/linux/seccomp-bpf/syscall_iterator.cc index 583dcf6..59a4e863 100644 --- a/sandbox/linux/seccomp-bpf/syscall_iterator.cc +++ b/sandbox/linux/seccomp-bpf/syscall_iterator.cc @@ -16,7 +16,8 @@ uint32_t SyscallIterator::Next() { do { // |num_| has been initialized to 0, which we assume is also MIN_SYSCALL. // This true for supported architectures (Intel and ARM EABI). - CHECK_EQ(MIN_SYSCALL, 0u); + COMPILE_ASSERT(MIN_SYSCALL == 0u, + min_syscall_should_always_be_zero); val = num_; // First we iterate up to MAX_PUBLIC_SYSCALL, which is equal to MAX_SYSCALL @@ -78,14 +79,16 @@ bool SyscallIterator::IsValid(uint32_t num) { return false; } -bool SyscallIterator::IsArmPrivate(uint32_t num) { #if defined(__arm__) && (defined(__thumb__) || defined(__ARM_EABI__)) +bool SyscallIterator::IsArmPrivate(uint32_t num) { return (num >= MIN_PRIVATE_SYSCALL && num <= MAX_PRIVATE_SYSCALL) || (num >= MIN_GHOST_SYSCALL && num <= MAX_SYSCALL); +} #else +bool SyscallIterator::IsArmPrivate(uint32_t) { return false; -#endif } +#endif } // namespace |