Skip to content

Commit 4c222f3

Browse files
committed
selftests/seccomp: sh: Fix register names
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 <glaubitz@physik.fu-berlin.de> Link: https://lore.kernel.org/lkml/a36d7b48-6598-1642-e403-0c77a86f416d@physik.fu-berlin.de Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent f5098e3 commit 4c222f3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,8 +1804,8 @@ TEST_F(TRACE_poke, getpid_runs_normally)
18041804
#define SYSCALL_RET(_regs) (_regs).a[(_regs).windowbase * 4 + 2]
18051805
#elif defined(__sh__)
18061806
# define ARCH_REGS struct pt_regs
1807-
# define SYSCALL_NUM(_regs) (_regs).gpr[3]
1808-
# define SYSCALL_RET(_regs) (_regs).gpr[0]
1807+
# define SYSCALL_NUM(_regs) (_regs).regs[3]
1808+
# define SYSCALL_RET(_regs) (_regs).regs[0]
18091809
#else
18101810
# error "Do not know how to find your architecture's registers and syscalls"
18111811
#endif

0 commit comments

Comments
 (0)