lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 9 Dec 2018 21:02:50 -0800
From:   Max Filippov <jcmvbkbc@...il.com>
To:     ldv@...linux.org
Cc:     oleg@...hat.com, Andrew Lutomirski <luto@...nel.org>,
        lineprinter@...linux.org, esyr@...hat.com,
        Chris Zankel <chris@...kel.net>,
        Paul Moore <paul@...l-moore.com>, eparis@...hat.com,
        linux-xtensa@...ux-xtensa.org, linux-audit@...hat.com,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 19/25] xtensa: define syscall_get_* functions

Hello,

On Sun, Dec 9, 2018 at 8:30 PM Dmitry V. Levin <ldv@...linux.org> wrote:
> syscall_get_* functions are required to be implemented on all
> architectures in order to extend the generic ptrace API with
> PTRACE_GET_SYSCALL_INFO request.
>
> This adds all 5 syscall_get_* functions on xtensa as documented
> in asm-generic/syscall.h: syscall_get_nr, syscall_get_arguments,
> syscall_get_error, syscall_get_return_value, and syscall_get_arch.

I have this set of functions plus syscall_set_arguments implemented
for syscall tracing here:
  https://github.com/jcmvbkbc/linux-xtensa/commit/0023f56298cc92ce47e61b1b5dd1038f7be4f826

How should we synchronize our changes?

> diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h
> index 3673ff1f1bc5..d529c855a144 100644
> --- a/arch/xtensa/include/asm/syscall.h
> +++ b/arch/xtensa/include/asm/syscall.h

[...]

> +static inline void
> +syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
> +                     unsigned int i, unsigned int n, unsigned long *args)
> +{
> +       switch (i) {
> +       case 0:
> +               if (!n--)
> +                       break;
> +               *args++ = regs->areg[6];
> +               /* fall through */
> +       case 1:
> +               if (!n--)
> +                       break;
> +               *args++ = regs->areg[3];
> +               /* fall through */
> +       case 2:
> +               if (!n--)
> +                       break;
> +               *args++ = regs->areg[4];
> +               /* fall through */
> +       case 3:
> +               if (!n--)
> +                       break;
> +               *args++ = regs->areg[5];
> +               /* fall through */
> +       case 4:
> +               if (!n--)
> +                       break;
> +               *args++ = regs->areg[8];
> +               /* fall through */
> +       case 5:
> +               if (!n--)
> +                       break;
> +               *args++ = regs->areg[9];
> +               /* fall through */
> +       case 6:
> +               if (!n--)
> +                       break;
> +               /* fall through */
> +       default:
> +               BUG();

A WARN should be enough.

-- 
Thanks.
-- Max

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ