lkml.org 
[lkml]   [2018]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@altlinux.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@kernel.org> # for x86
> Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
> Acked-by: Paul Burton <paul.burton@mips.com> # MIPS parts
> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

For the seccomp parts:

Acked-by: Kees Cook <keescook@chromium.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

\
 
 \ /
  Last update: 2018-12-10 18:31    [W:0.058 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site