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]
Message-ID: <8e2f9ac6-b277-0b80-c150-eb372fbeaf0a@linux-m68k.org>
Date:   Fri, 29 May 2020 23:21:38 +1000
From:   Greg Ungerer <gerg@...ux-m68k.org>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org,
        kbuild test robot <lkp@...el.com>
Subject: Re: [PATCH 2/2] m68k,nommu: fix implicit cast from __user in
 __{get,put}_user_asm()

Hi Luc,

On 29/5/20 6:25 am, Luc Van Oostenryck wrote:
> The assembly for __get_user_asm() & __put_user_asm() uses memcpy()
> when the size is 8.
> 
> However, the pointer is always a __user one while memcpy() expect
> a plan one and so this cast creates a lot of warnings when using     ^^^^
Did you mean "plain"?


> Sparse.
> 
> So, fix this by adding a cast to 'void __force *' at memcpy()'s
> argument.
> 
> Reported-by: kbuild test robot <lkp@...el.com>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
> ---
>   arch/m68k/include/asm/uaccess_no.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/m68k/include/asm/uaccess_no.h b/arch/m68k/include/asm/uaccess_no.h
> index 9651766a62af..f32f08a64eaa 100644
> --- a/arch/m68k/include/asm/uaccess_no.h
> +++ b/arch/m68k/include/asm/uaccess_no.h
> @@ -42,7 +42,7 @@ static inline int _access_ok(unsigned long addr, unsigned long size)
>   	__put_user_asm(__pu_err, __pu_val, ptr, l);	\
>   	break;						\
>       case 8:						\
> -	memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
> +	memcpy((void __force*)ptr, &__pu_val, sizeof (*(ptr))); \
                            ^^^
checkpatch wants a ' ' space in there.

Otherwise I think it looks good.

Regards
Greg

  
>   	break;						\
>       default:						\
>   	__pu_err = __put_user_bad();			\
> @@ -85,7 +85,7 @@ extern int __put_user_bad(void);
>   	    u64 l;						\
>   	    __typeof__(*(ptr)) t;				\
>   	} __gu_val;						\
> -	memcpy(&__gu_val.l, ptr, sizeof(__gu_val.l));		\
> +	memcpy(&__gu_val.l, (const void __force*)ptr, sizeof(__gu_val.l));		\
>   	(x) = __gu_val.t;					\
>   	break;							\
>       }								\
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ