public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* seccomp selftest on s390
@ 2015-08-20 21:33 Kees Cook
  0 siblings, 0 replies; only message in thread
From: Kees Cook @ 2015-08-20 21:33 UTC (permalink / raw)
  To: Jan Willeke, Heiko Carstens; +Cc: LKML, Andy Lutomirski

Hi!

I don't have access to s390 running a modern kernel, so I've not been able
to meaningfully run the seccomp selftest suite. In a quick review, I think
the following is close to the missing pieces, but I can't verify it. :)

Can someone let me know if this works, or otherwise check that the
tools/testing/selftests/seccomp suite passes on s390?

Thanks!

-Kees

--- seccomp_bpf.c.orig	2015-08-20 21:13:17.735789007 +0000
+++ seccomp_bpf.c	2015-08-20 21:09:49.547879621 +0000
@@ -1210,6 +1211,10 @@
 # define ARCH_REGS	struct pt_regs
 # define SYSCALL_NUM	gpr[0]
 # define SYSCALL_RET	gpr[3]
+#elif defined(__s390__)
+# define ARCH_REGS	s390_regs
+# define SYSCALL_NUM	gprs[1]
+# define SYSCALL_RET	gprs[2]
 #else
 # error "Do not know how to find your architecture's registers and syscalls"
 #endif
@@ -1243,7 +1248,7 @@
 	ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov);
 	EXPECT_EQ(0, ret);
 
-#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) || defined(__s390__)
 	{
 		regs.SYSCALL_NUM = syscall;
 	}

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-20 21:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 21:33 seccomp selftest on s390 Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox