Skip to content

Commit

Permalink
selftests/seccomp: sh: Fix register names
Browse files Browse the repository at this point in the history
It looks like the seccomp selftests was never actually built for sh.
This fixes it, though I don't have an environment to do a runtime test
of it yet.

Fixes: 0bb605c ("sh: Add SECCOMP_FILTER")
Tested-by: John Paul Adrian Glaubitz <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
kees committed Nov 20, 2020
1 parent f5098e3 commit 4c222f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/seccomp/seccomp_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,8 +1804,8 @@ TEST_F(TRACE_poke, getpid_runs_normally)
#define SYSCALL_RET(_regs) (_regs).a[(_regs).windowbase * 4 + 2]
#elif defined(__sh__)
# define ARCH_REGS struct pt_regs
# define SYSCALL_NUM(_regs) (_regs).gpr[3]
# define SYSCALL_RET(_regs) (_regs).gpr[0]
# define SYSCALL_NUM(_regs) (_regs).regs[3]
# define SYSCALL_RET(_regs) (_regs).regs[0]
#else
# error "Do not know how to find your architecture's registers and syscalls"
#endif
Expand Down

0 comments on commit 4c222f3

Please sign in to comment.