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] [day] [month] [year] [list]
Date:   Tue, 9 Apr 2019 15:57:36 +0800
From:   Greentime Hu <green.hu@...il.com>
To:     "Dmitry V. Levin" <ldv@...linux.org>
Cc:     Vincent Chen <deanbo422@...il.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Elvira Khabirova <lineprinter@...linux.org>,
        Eugene Syromyatnikov <esyr@...hat.com>,
        Oleg Nesterov <oleg@...hat.com>,
        Andy Lutomirski <luto@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH linux-next v9 1/7] nds32: fix asm/syscall.h

Dmitry V. Levin <ldv@...linux.org> 於 2019年4月9日 週二 上午1:41寫道:
>
> All syscall_get_*() and syscall_set_*() functions must be defined
> as static inline as on all other architectures, otherwise asm/syscall.h
> cannot be included in more than one compilation unit.
>
> This bug has to be fixed in order to extend the generic
> ptrace API with PTRACE_GET_SYSCALL_INFO request.
>
> Reported-by: kbuild test robot <lkp@...el.com>
> Fixes: 1932fbe36e02 ("nds32: System calls handling")
> Cc: Greentime Hu <green.hu@...il.com>
> Cc: Vincent Chen <deanbo422@...il.com>
> Cc: Elvira Khabirova <lineprinter@...linux.org>
> Cc: Eugene Syromyatnikov <esyr@...hat.com>
> Cc: Oleg Nesterov <oleg@...hat.com>
> Cc: Andy Lutomirski <luto@...nel.org>
> Signed-off-by: Dmitry V. Levin <ldv@...linux.org>
> ---
>
> Dear nds32 maintainers, this fix is waiting for ACK since early January.
>
> Notes:
>     v9: rebased to linux-next again due to syscall_get_arguments() signature change
>     v8: unchanged
>     v7: initial revision
>
>  arch/nds32/include/asm/syscall.h | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/arch/nds32/include/asm/syscall.h b/arch/nds32/include/asm/syscall.h
> index 174b8571d362..d08439a54034 100644
> --- a/arch/nds32/include/asm/syscall.h
> +++ b/arch/nds32/include/asm/syscall.h
> @@ -26,7 +26,8 @@ struct pt_regs;
>   *
>   * It's only valid to call this when @task is known to be blocked.
>   */
> -int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
> +static inline int
> +syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
>  {
>         return regs->syscallno;
>  }
> @@ -47,7 +48,8 @@ int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
>   * system call instruction.  This may not be the same as what the
>   * register state looked like at system call entry tracing.
>   */
> -void syscall_rollback(struct task_struct *task, struct pt_regs *regs)
> +static inline void
> +syscall_rollback(struct task_struct *task, struct pt_regs *regs)
>  {
>         regs->uregs[0] = regs->orig_r0;
>  }
> @@ -62,7 +64,8 @@ void syscall_rollback(struct task_struct *task, struct pt_regs *regs)
>   * It's only valid to call this when @task is stopped for tracing on exit
>   * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
>   */
> -long syscall_get_error(struct task_struct *task, struct pt_regs *regs)
> +static inline long
> +syscall_get_error(struct task_struct *task, struct pt_regs *regs)
>  {
>         unsigned long error = regs->uregs[0];
>         return IS_ERR_VALUE(error) ? error : 0;
> @@ -79,7 +82,8 @@ long syscall_get_error(struct task_struct *task, struct pt_regs *regs)
>   * It's only valid to call this when @task is stopped for tracing on exit
>   * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
>   */
> -long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
> +static inline long
> +syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
>  {
>         return regs->uregs[0];
>  }
> @@ -99,8 +103,9 @@ long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
>   * It's only valid to call this when @task is stopped for tracing on exit
>   * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
>   */
> -void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
> -                             int error, long val)
> +static inline void
> +syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
> +                        int error, long val)
>  {
>         regs->uregs[0] = (long)error ? error : val;
>  }
> @@ -118,8 +123,9 @@ void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
>   * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
>   */
>  #define SYSCALL_MAX_ARGS 6
> -void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
> -                          unsigned long *args)
> +static inline void
> +syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
> +                     unsigned long *args)
>  {
>         args[0] = regs->orig_r0;
>         args++;
> @@ -138,8 +144,9 @@ void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
>   * It's only valid to call this when @task is stopped for tracing on
>   * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
>   */
> -void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
> -                          const unsigned long *args)
> +static inline void
> +syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
> +                     const unsigned long *args)
>  {
>         regs->orig_r0 = args[0];
>         args++;

Sorry for late.
Acked-by: Greentime Hu <greentime@...estech.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ