m68k: add missing __user annotation in get_user()
PATCH 1/1 m68k: add missing __user annotation in get_user()
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_ptrdrivers/vhost/vhost.c:1603:13: sparse: got unsigned int [noderef] [usertype] <asn:1> *idxp
--- arch/m68k/include/asm/uaccess_mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/include/asm/uaccess_mm.h +1 -1
@@ -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; \
Signature · 1 line
2.20.1
Quoted 7 lines · Jason Wang
The ptr is a pointer to userspace memory. So we need annotate it with
__userotherwise 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_ptrdrivers/vhost/vhost.c:1603:13: sparse: got unsigned int [noderef] [usertype] <asn:1> *idxp
Quoted 5 lines
Cc Geert Uytterhoeven <[email protected]>Reported-by kbuild test robot <[email protected]>Signed-off-by Jason Wang <[email protected]>
Makes sense:
Quoted 19 lines
--- arch/m68k/include/asm/uaccess_mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/m68k/include/asm/uaccess_mm.h +1
-1@@ -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; \Signature · 1 line
2.20.1
Quoted 7 lines · Jason Wang
The ptr is a pointer to userspace memory. So we need annotate it with
__userotherwise 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_ptrdrivers/vhost/vhost.c:1603:13: sparse: got unsigned int [noderef] [usertype] <asn:1> *idxp
Quoted 5 lines
Cc Geert Uytterhoeven <[email protected]>Reported-by kbuild test robot <[email protected]>Signed-off-by Jason Wang <[email protected]>
i.e. will queue in the m68k for-v5.8 branch.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds