linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/seccomp: sh: Fix register names
@ 2020-11-17 20:56 Kees Cook
  2020-11-17 21:08 ` John Paul Adrian Glaubitz
  2020-11-17 22:57 ` John Paul Adrian Glaubitz
  0 siblings, 2 replies; 6+ messages in thread
From: Kees Cook @ 2020-11-17 20:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kees Cook, John Paul Adrian Glaubitz, Michael Karcher,
	Rich Felker, Andy Lutomirski, Will Drewry, linux-kselftest

It looks like the seccomp selftests were never actually built for sh.
This fixes it, though I don't have an environment to do a runtime test
of it yet.

Fixes: 0bb605c2c7f2b4b3 ("sh: Add SECCOMP_FILTER")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 tools/testing/selftests/seccomp/seccomp_bpf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 7f7ecfcd66db..26c72f2b61b1 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-20 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 20:56 [PATCH] selftests/seccomp: sh: Fix register names Kees Cook
2020-11-17 21:08 ` John Paul Adrian Glaubitz
2020-11-17 21:35   ` Kees Cook
2020-11-17 21:41     ` John Paul Adrian Glaubitz
2020-11-17 22:57 ` John Paul Adrian Glaubitz
2020-11-20 19:05   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).