Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions test/syscalls/linux/bad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ namespace {
// gVisor.
constexpr uint32_t kNotImplementedSyscall = SYS_get_kernel_syms;
#elif defined(__aarch64__)
// Use the last of arch_specific_syscalls which are not implemented on arm64.
constexpr uint32_t kNotImplementedSyscall = __NR_arch_specific_syscall + 15;
// ARM64 leaves the architecture-specific range (244-259) unassigned.
// https://github.com/torvalds/linux/blob/7d0a66e4b/scripts/syscall.tbl#L291-L305
constexpr uint32_t kNotImplementedSyscall = 259;
#elif defined(__riscv)
// `__NR_arch_specific_syscall + 15` is used on RISC-V for
// `sys_riscv_flush_icache(). Use `__NR_arch_specific_syscall + 14` instead.
constexpr uint32_t kNotImplementedSyscall = __NR_arch_specific_syscall + 14;
// Slot 257 is unassigned; 258 and 259 are riscv_hwprobe and riscv_flush_icache.
// https://github.com/torvalds/linux/blob/7d0a66e4b/scripts/syscall.tbl#L291-L305
constexpr uint32_t kNotImplementedSyscall = 257;
#endif

TEST(BadSyscallTest, NotImplemented) {
Expand Down
5 changes: 3 additions & 2 deletions test/syscalls/linux/seccomp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ namespace {
#ifdef __x86_64__
constexpr uint32_t kFilteredSyscall = SYS_vserver;
#elif __aarch64__
// Use the last of arch_specific_syscalls which are not implemented on arm64.
constexpr uint32_t kFilteredSyscall = __NR_arch_specific_syscall + 15;
// ARM64 leaves the architecture-specific range (244-259) unassigned.
// https://github.com/torvalds/linux/blob/7d0a66e4b/scripts/syscall.tbl#L291-L305
constexpr uint32_t kFilteredSyscall = 259;
#endif

// Applies a seccomp-bpf filter that returns `filtered_result` for
Expand Down
Loading