[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jKMWDGu0VbMd08XMdyzu6JHGjpTPDQ_Z6aQ6Hz4uv=tzg@mail.gmail.com>
Date: Mon, 10 Dec 2018 09:29:45 -0800
From: Kees Cook <keescook@...omium.org>
To: "Dmitry V. Levin" <ldv@...linux.org>
Cc: Andy Lutomirski <luto@...nel.org>,
Palmer Dabbelt <palmer@...ive.com>,
Paul Burton <paul.burton@...s.com>,
Michael Ellerman <mpe@...erman.id.au>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 22/25] syscall_get_arch: add "struct task_struct *" argument
On Sun, Dec 9, 2018 at 8:31 PM Dmitry V. Levin <ldv@...linux.org> wrote:
>
> This argument is required to extend the generic ptrace API with
> PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going
> to be called from ptrace_request() along with syscall_get_nr(),
> syscall_get_arguments(), syscall_get_error(), and
> syscall_get_return_value() functions with a tracee as their argument.
>
> Reverts: 5e937a9ae913 ("syscall_get_arch: remove useless function arguments")
> Reverts: 1002d94d3076 ("syscall.h: fix doc text for syscall_get_arch()")
> Reviewed-by: Andy Lutomirski <luto@...nel.org> # for x86
> Reviewed-by: Palmer Dabbelt <palmer@...ive.com>
> Acked-by: Paul Burton <paul.burton@...s.com> # MIPS parts
> Acked-by: Michael Ellerman <mpe@...erman.id.au> (powerpc)
For the seccomp parts:
Acked-by: Kees Cook <keescook@...omium.org>
-Kees
> diff --git a/kernel/seccomp.c b/kernel/seccomp.c
> index f2ae2324c232..77cb87bd2eae 100644
> --- a/kernel/seccomp.c
> +++ b/kernel/seccomp.c
> @@ -82,7 +82,7 @@ static void populate_seccomp_data(struct seccomp_data *sd)
> unsigned long args[6];
>
> sd->nr = syscall_get_nr(task, regs);
> - sd->arch = syscall_get_arch();
> + sd->arch = syscall_get_arch(task);
> syscall_get_arguments(task, regs, 0, 6, args);
> sd->args[0] = args[0];
> sd->args[1] = args[1];
> @@ -529,7 +529,7 @@ static void seccomp_init_siginfo(kernel_siginfo_t *info, int syscall, int reason
> info->si_code = SYS_SECCOMP;
> info->si_call_addr = (void __user *)KSTK_EIP(current);
> info->si_errno = reason;
> - info->si_arch = syscall_get_arch();
> + info->si_arch = syscall_get_arch(current);
> info->si_syscall = syscall;
> }
>
> --
> ldv
--
Kees Cook
Powered by blists - more mailing lists