seccomp selftest on s390
From: Kees Cook
Date: Thu Aug 20 2015 - 17:33:32 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/