From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752707AbbHTVd3 (ORCPT ); Thu, 20 Aug 2015 17:33:29 -0400 Received: from smtp.outflux.net ([198.145.64.163]:35273 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbbHTVd2 (ORCPT ); Thu, 20 Aug 2015 17:33:28 -0400 Date: Thu, 20 Aug 2015 14:33:23 -0700 From: Kees Cook To: Jan Willeke , Heiko Carstens Cc: LKML , Andy Lutomirski Subject: seccomp selftest on s390 Message-ID: <20150820213323.GL16279@outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Chrome OS X-HELO: www.outflux.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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