All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>,
	strosake@linux.vnet.ibm.com, bogdan.purcareata@freescale.com
Subject: Re: [RFC PATCH 12/12] selftests/seccomp: Add powerpc support
Date: Wed, 15 Jul 2015 08:16:49 -0700	[thread overview]
Message-ID: <CAGXu5jK0TMJ-K6jYrZMzeMFb0QYC4Zg-9Sdd-ih+Qpj2EG9fsQ@mail.gmail.com> (raw)
In-Reply-To: <1436945834-26660-12-git-send-email-mpe@ellerman.id.au>

On Wed, Jul 15, 2015 at 12:37 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Wire up the syscall number and regs so the tests work on powerpc.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  tools/testing/selftests/seccomp/seccomp_bpf.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> index 51adb9afb511..05fcdb974df6 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -14,6 +14,7 @@
>  #include <linux/filter.h>
>  #include <sys/prctl.h>
>  #include <sys/ptrace.h>
> +#include <sys/types.h>
>  #include <sys/user.h>
>  #include <linux/prctl.h>
>  #include <linux/ptrace.h>
> @@ -1209,6 +1210,10 @@ TEST_F(TRACE_poke, getpid_runs_normally)
>  # define ARCH_REGS     struct user_pt_regs
>  # define SYSCALL_NUM   regs[8]
>  # define SYSCALL_RET   regs[0]
> +#elif defined(__powerpc__)
> +# define ARCH_REGS     struct pt_regs
> +# define SYSCALL_NUM   gpr[0]
> +# define SYSCALL_RET   gpr[3]
>  #else
>  # error "Do not know how to find your architecture's registers and syscalls"
>  #endif
> @@ -1242,7 +1247,7 @@ void change_syscall(struct __test_metadata *_metadata,
>         ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov);
>         EXPECT_EQ(0, ret);
>
> -#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
> +#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__)
>         {
>                 regs.SYSCALL_NUM = syscall;
>         }
> @@ -1406,6 +1411,8 @@ TEST_F(TRACE_syscall, syscall_dropped)
>  #  define __NR_seccomp 383
>  # elif defined(__aarch64__)
>  #  define __NR_seccomp 277
> +# elif defined(__powerpc__)
> +#  define __NR_seccomp 358
>  # else
>  #  warning "seccomp syscall number unknown for this architecture"
>  #  define __NR_seccomp 0xffff
> --
> 2.1.0
>



-- 
Kees Cook
Chrome OS Security

  reply	other threads:[~2015-07-15 15:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15  7:37 [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter() Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 02/12] powerpc/kernel: Switch to using MAX_ERRNO Michael Ellerman
2015-07-16 22:42   ` Benjamin Herrenschmidt
2015-07-15  7:37 ` [RFC PATCH 03/12] powerpc/kernel: Change the do_syscall_trace_enter() API Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 04/12] powerpc: Drop unused syscall_get_error() Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 05/12] powerpc: Don't negate error in syscall_set_return_value() Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 06/12] powerpc: Rework syscall_get_arguments() so there is only one loop Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 07/12] powerpc: Use orig_gpr3 in syscall_get_arguments() Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 08/12] powerpc: Change syscall_get_nr() to return int Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 09/12] powerpc/kernel: Add SIG_SYS support for compat tasks Michael Ellerman
2015-07-15 15:12   ` Kees Cook
2015-07-16  3:38     ` Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 10/12] powerpc/kernel: Enable seccomp filter Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 11/12] selftests/seccomp: Make seccomp tests work on big endian Michael Ellerman
2015-07-15 15:16   ` Kees Cook
2015-07-16  3:41     ` Michael Ellerman
2015-07-15  7:37 ` [RFC PATCH 12/12] selftests/seccomp: Add powerpc support Michael Ellerman
2015-07-15 15:16   ` Kees Cook [this message]
2015-07-16 22:40 ` [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter() Benjamin Herrenschmidt
2015-07-17  4:41   ` Michael Ellerman
2015-07-17  4:41     ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGXu5jK0TMJ-K6jYrZMzeMFb0QYC4Zg-9Sdd-ih+Qpj2EG9fsQ@mail.gmail.com \
    --to=keescook@chromium.org \
    --cc=bogdan.purcareata@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=luto@amacapital.net \
    --cc=mpe@ellerman.id.au \
    --cc=strosake@linux.vnet.ibm.com \
    --cc=wad@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.