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]
Message-ID: <20200520045441-mutt-send-email-mst@kernel.org>
Date:   Wed, 20 May 2020 04:55:47 -0400
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Jason Wang <jasowang@...hat.com>
Cc:     geert@...ux-m68k.org, linux-m68k@...ts.linux-m68k.org,
        linux-kernel@...r.kernel.org, kbuild test robot <lkp@...el.com>
Subject: Re: [PATCH] m68k: add missing __user annotation in get_user()

On Wed, May 20, 2020 at 02:57:50PM +0800, Jason Wang wrote:
> The ptr is a pointer to userspace memory. So we need annotate it with
> __user otherwise we may get sparse warnings like:
> 
> drivers/vhost/vhost.c:1603:13: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void const *__gu_ptr @@    got unsigned int [noderef] [usertypvoid const *__gu_ptr @@
> drivers/vhost/vhost.c:1603:13: sparse:    expected void const *__gu_ptr
> drivers/vhost/vhost.c:1603:13: sparse:    got unsigned int [noderef] [usertype] <asn:1> *idxp
> 
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> Cc: linux-m68k@...ts.linux-m68k.org
> Cc: linux-kernel@...r.kernel.org
> Reported-by: kbuild test robot <lkp@...el.com>
> Signed-off-by: Jason Wang <jasowang@...hat.com>

Makes sense:

Acked-by: Michael S. Tsirkin <mst@...hat.com>

> ---
>  arch/m68k/include/asm/uaccess_mm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h
> index 7e85de984df1..9ae9f8d05925 100644
> --- a/arch/m68k/include/asm/uaccess_mm.h
> +++ b/arch/m68k/include/asm/uaccess_mm.h
> @@ -142,7 +142,7 @@ asm volatile ("\n"					\
>  		__get_user_asm(__gu_err, x, ptr, u32, l, r, -EFAULT);	\
>  		break;							\
>  	case 8: {							\
> -		const void *__gu_ptr = (ptr);				\
> +		const void __user *__gu_ptr = (ptr);			\
>  		union {							\
>  			u64 l;						\
>  			__typeof__(*(ptr)) t;				\
> -- 
> 2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ