All of lore.kernel.org
 help / color / mirror / Atom feed
* [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces)
@ 2020-07-17 14:07 kernel test robot
  2020-07-17 16:40 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-07-17 14:07 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 13873 bytes --]

tree:   git://git.infradead.org/users/hch/misc.git sockopt-cleanups
head:   c7b33f366ac60f1213a4ff71675dc62c56f171d3
commit: 5a4c63f8320f6acd2dd457dd96c84e1ffeef580a [17/22] net/ipv4: remove compat_ip_{get,set}sockopt
config: openrisc-randconfig-s031-20200717 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.2-49-g707c5017-dirty
        git checkout 5a4c63f8320f6acd2dd457dd96c84e1ffeef580a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

   net/ipv4/ip_sockglue.c:908:29: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   net/ipv4/ip_sockglue.c:908:29: sparse:     expected int const *__gu_addr
   net/ipv4/ip_sockglue.c:908:29: sparse:     got int [noderef] __user *
   net/ipv4/ip_sockglue.c:913:29: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned char const *__gu_addr @@     got unsigned char [noderef] __user * @@
   net/ipv4/ip_sockglue.c:913:29: sparse:     expected unsigned char const *__gu_addr
   net/ipv4/ip_sockglue.c:913:29: sparse:     got unsigned char [noderef] __user *
   net/ipv4/ip_sockglue.c:1456:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1456:13: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1456:13: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1488:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1488:13: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1488:13: sparse:     got int [noderef] __user *optlen
>> net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] __user * @@
>> net/ipv4/ip_sockglue.c:1489:13: sparse:     expected unsigned int *__pu_addr
   net/ipv4/ip_sockglue.c:1489:13: sparse:     got unsigned int [noderef] __user *
   net/ipv4/ip_sockglue.c:1490:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] __user * @@
   net/ipv4/ip_sockglue.c:1490:13: sparse:     expected unsigned int *__pu_addr
   net/ipv4/ip_sockglue.c:1490:13: sparse:     got unsigned int [noderef] __user *
   net/ipv4/ip_sockglue.c:1509:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1509:13: sparse:     expected int const *__gu_addr
   net/ipv4/ip_sockglue.c:1509:13: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1535:32: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1535:32: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1535:32: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1540:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1540:21: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1540:21: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1630:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1630:21: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1630:21: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1693:24: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1693:24: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1693:24: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1713:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1713:21: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1713:21: sparse:     got int [noderef] __user *optlen
   net/ipv4/ip_sockglue.c:1719:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
   net/ipv4/ip_sockglue.c:1719:21: sparse:     expected int *__pu_addr
   net/ipv4/ip_sockglue.c:1719:21: sparse:     got int [noderef] __user *optlen
   arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from

vim +1489 net/ipv4/ip_sockglue.c

4aa551d47237465 Christoph Hellwig 2020-07-15  1461  
4aa551d47237465 Christoph Hellwig 2020-07-15  1462  static int compat_ip_get_mcast_msfilter(struct sock *sk, void __user *optval,
5a4c63f8320f6ac Christoph Hellwig 2020-07-16  1463  		int __user *optlen, int len)
4aa551d47237465 Christoph Hellwig 2020-07-15  1464  {
4aa551d47237465 Christoph Hellwig 2020-07-15  1465  	const int size0 = offsetof(struct compat_group_filter, gf_slist);
4aa551d47237465 Christoph Hellwig 2020-07-15  1466  	struct compat_group_filter __user *p = optval;
4aa551d47237465 Christoph Hellwig 2020-07-15  1467  	struct compat_group_filter gf32;
4aa551d47237465 Christoph Hellwig 2020-07-15  1468  	struct group_filter gf;
4aa551d47237465 Christoph Hellwig 2020-07-15  1469  	int num;
5a4c63f8320f6ac Christoph Hellwig 2020-07-16  1470  	int err;
4aa551d47237465 Christoph Hellwig 2020-07-15  1471  
4aa551d47237465 Christoph Hellwig 2020-07-15  1472  	if (len < size0)
4aa551d47237465 Christoph Hellwig 2020-07-15  1473  		return -EINVAL;
4aa551d47237465 Christoph Hellwig 2020-07-15  1474  	if (copy_from_user(&gf32, p, size0))
4aa551d47237465 Christoph Hellwig 2020-07-15  1475  		return -EFAULT;
4aa551d47237465 Christoph Hellwig 2020-07-15  1476  
4aa551d47237465 Christoph Hellwig 2020-07-15  1477  	gf.gf_interface = gf32.gf_interface;
4aa551d47237465 Christoph Hellwig 2020-07-15  1478  	gf.gf_fmode = gf32.gf_fmode;
4aa551d47237465 Christoph Hellwig 2020-07-15  1479  	num = gf.gf_numsrc = gf32.gf_numsrc;
4aa551d47237465 Christoph Hellwig 2020-07-15  1480  	gf.gf_group = gf32.gf_group;
4aa551d47237465 Christoph Hellwig 2020-07-15  1481  
4aa551d47237465 Christoph Hellwig 2020-07-15  1482  	err = ip_mc_gsfget(sk, &gf, p->gf_slist);
4aa551d47237465 Christoph Hellwig 2020-07-15  1483  	if (err)
4aa551d47237465 Christoph Hellwig 2020-07-15  1484  		return err;
4aa551d47237465 Christoph Hellwig 2020-07-15  1485  	if (gf.gf_numsrc < num)
4aa551d47237465 Christoph Hellwig 2020-07-15  1486  		num = gf.gf_numsrc;
4aa551d47237465 Christoph Hellwig 2020-07-15  1487  	len = GROUP_FILTER_SIZE(num) - (sizeof(gf) - sizeof(gf32));
4aa551d47237465 Christoph Hellwig 2020-07-15  1488  	if (put_user(len, optlen) ||
4aa551d47237465 Christoph Hellwig 2020-07-15 @1489  	    put_user(gf.gf_fmode, &p->gf_fmode) ||
4aa551d47237465 Christoph Hellwig 2020-07-15  1490  	    put_user(gf.gf_numsrc, &p->gf_numsrc))
4aa551d47237465 Christoph Hellwig 2020-07-15  1491  		return -EFAULT;
4aa551d47237465 Christoph Hellwig 2020-07-15  1492  	return 0;
4aa551d47237465 Christoph Hellwig 2020-07-15  1493  }
4aa551d47237465 Christoph Hellwig 2020-07-15  1494  

:::::: The code at line 1489 was first introduced by commit
:::::: 4aa551d4723746507de5fb607831811a9e458837 net/ipv4: factor out MCAST_MSFILTER getsockopt helpers

:::::: TO: Christoph Hellwig <hch@lst.de>
:::::: CC: Christoph Hellwig <hch@lst.de>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24308 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-07-17 14:07 [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces) kernel test robot
@ 2020-07-17 16:40 ` Christoph Hellwig
  2020-07-17 21:24   ` Stafford Horne
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-07-17 16:40 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 14565 bytes --]

As far as I can tell the sparse annotations in the openrisc headers
are all messed up, and this is caused by that (just as the other one).

Can you guys drop openriscv sparse runs for now?

Or can the openrisc maintainers tries to fix up the sparse annotations
in their uaccess macros?

On Fri, Jul 17, 2020 at 10:07:06PM +0800, kernel test robot wrote:
> tree:   git://git.infradead.org/users/hch/misc.git sockopt-cleanups
> head:   c7b33f366ac60f1213a4ff71675dc62c56f171d3
> commit: 5a4c63f8320f6acd2dd457dd96c84e1ffeef580a [17/22] net/ipv4: remove compat_ip_{get,set}sockopt
> config: openrisc-randconfig-s031-20200717 (attached as .config)
> compiler: or1k-linux-gcc (GCC) 9.3.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.2-49-g707c5017-dirty
>         git checkout 5a4c63f8320f6acd2dd457dd96c84e1ffeef580a
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    net/ipv4/ip_sockglue.c:908:29: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
>    net/ipv4/ip_sockglue.c:908:29: sparse:     expected int const *__gu_addr
>    net/ipv4/ip_sockglue.c:908:29: sparse:     got int [noderef] __user *
>    net/ipv4/ip_sockglue.c:913:29: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned char const *__gu_addr @@     got unsigned char [noderef] __user * @@
>    net/ipv4/ip_sockglue.c:913:29: sparse:     expected unsigned char const *__gu_addr
>    net/ipv4/ip_sockglue.c:913:29: sparse:     got unsigned char [noderef] __user *
>    net/ipv4/ip_sockglue.c:1456:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1456:13: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1456:13: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1488:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1488:13: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1488:13: sparse:     got int [noderef] __user *optlen
> >> net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] __user * @@
> >> net/ipv4/ip_sockglue.c:1489:13: sparse:     expected unsigned int *__pu_addr
>    net/ipv4/ip_sockglue.c:1489:13: sparse:     got unsigned int [noderef] __user *
>    net/ipv4/ip_sockglue.c:1490:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] __user * @@
>    net/ipv4/ip_sockglue.c:1490:13: sparse:     expected unsigned int *__pu_addr
>    net/ipv4/ip_sockglue.c:1490:13: sparse:     got unsigned int [noderef] __user *
>    net/ipv4/ip_sockglue.c:1509:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1509:13: sparse:     expected int const *__gu_addr
>    net/ipv4/ip_sockglue.c:1509:13: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1535:32: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1535:32: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1535:32: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1540:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1540:21: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1540:21: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1630:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1630:21: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1630:21: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1693:24: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1693:24: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1693:24: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1713:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1713:21: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1713:21: sparse:     got int [noderef] __user *optlen
>    net/ipv4/ip_sockglue.c:1719:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user *optlen @@
>    net/ipv4/ip_sockglue.c:1719:21: sparse:     expected int *__pu_addr
>    net/ipv4/ip_sockglue.c:1719:21: sparse:     got int [noderef] __user *optlen
>    arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
>    include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
>    include/linux/uaccess.h:131:38: sparse:     expected void *to
>    include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
>    include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
>    include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
>    include/linux/uaccess.h:131:42: sparse:     got void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
>    include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
>    include/linux/uaccess.h:131:38: sparse:     expected void *to
>    include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
>    include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
>    include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
>    include/linux/uaccess.h:131:42: sparse:     got void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
>    include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
>    include/linux/uaccess.h:131:38: sparse:     expected void *to
>    include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
>    include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
>    include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
>    include/linux/uaccess.h:131:42: sparse:     got void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
>    include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
>    include/linux/uaccess.h:131:38: sparse:     expected void *to
>    include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
>    include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
>    include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
>    include/linux/uaccess.h:131:42: sparse:     got void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
>    include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] __user *to @@
>    include/linux/uaccess.h:131:38: sparse:     expected void *to
>    include/linux/uaccess.h:131:38: sparse:     got void [noderef] __user *to
>    include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got void const *from @@
>    include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] __user *from
>    include/linux/uaccess.h:131:42: sparse:     got void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] __user *from @@
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
>    arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] __user *from
> 
> vim +1489 net/ipv4/ip_sockglue.c
> 
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1461  
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1462  static int compat_ip_get_mcast_msfilter(struct sock *sk, void __user *optval,
> 5a4c63f8320f6ac Christoph Hellwig 2020-07-16  1463  		int __user *optlen, int len)
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1464  {
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1465  	const int size0 = offsetof(struct compat_group_filter, gf_slist);
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1466  	struct compat_group_filter __user *p = optval;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1467  	struct compat_group_filter gf32;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1468  	struct group_filter gf;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1469  	int num;
> 5a4c63f8320f6ac Christoph Hellwig 2020-07-16  1470  	int err;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1471  
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1472  	if (len < size0)
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1473  		return -EINVAL;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1474  	if (copy_from_user(&gf32, p, size0))
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1475  		return -EFAULT;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1476  
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1477  	gf.gf_interface = gf32.gf_interface;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1478  	gf.gf_fmode = gf32.gf_fmode;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1479  	num = gf.gf_numsrc = gf32.gf_numsrc;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1480  	gf.gf_group = gf32.gf_group;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1481  
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1482  	err = ip_mc_gsfget(sk, &gf, p->gf_slist);
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1483  	if (err)
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1484  		return err;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1485  	if (gf.gf_numsrc < num)
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1486  		num = gf.gf_numsrc;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1487  	len = GROUP_FILTER_SIZE(num) - (sizeof(gf) - sizeof(gf32));
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1488  	if (put_user(len, optlen) ||
> 4aa551d47237465 Christoph Hellwig 2020-07-15 @1489  	    put_user(gf.gf_fmode, &p->gf_fmode) ||
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1490  	    put_user(gf.gf_numsrc, &p->gf_numsrc))
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1491  		return -EFAULT;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1492  	return 0;
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1493  }
> 4aa551d47237465 Christoph Hellwig 2020-07-15  1494  
> 
> :::::: The code at line 1489 was first introduced by commit
> :::::: 4aa551d4723746507de5fb607831811a9e458837 net/ipv4: factor out MCAST_MSFILTER getsockopt helpers
> 
> :::::: TO: Christoph Hellwig <hch@lst.de>
> :::::: CC: Christoph Hellwig <hch@lst.de>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


---end quoted text---

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-07-17 16:40 ` Christoph Hellwig
@ 2020-07-17 21:24   ` Stafford Horne
  2020-07-18  7:02     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Stafford Horne @ 2020-07-17 21:24 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2031 bytes --]

On Fri, Jul 17, 2020 at 06:40:11PM +0200, Christoph Hellwig wrote:
> As far as I can tell the sparse annotations in the openrisc headers
> are all messed up, and this is caused by that (just as the other one).
> 
> Can you guys drop openriscv sparse runs for now?
> 
> Or can the openrisc maintainers tries to fix up the sparse annotations
> in their uaccess macros?
> 
I will have a look at it.  I have this patch on my queue that fixes one issue,
not sure if its fixes "all" issues, I never used sparse until now.

I was planning to send this during the 5.9 merge window, but I can send now if
its urgent.

-Stafford

>From 1024e6bf431fab6b7ada5244b570e91e33190257 Mon Sep 17 00:00:00 2001
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Date: Mon, 22 Jun 2020 14:11:24 +0200
Subject: [PATCH] openrisc: fix __user in raw_copy_to_user()'s prototype

raw_copy_to_user()'s prototype seems to be a copy & paste of
raw_copy_from_user() and as such has the __user annotation
in the 'from' argument instead of the 'to'.

So, move the __user annotation in the prototype to the 'to'.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/openrisc/include/asm/uaccess.h
b/arch/openrisc/include/asm/uaccess.h
index 17c24f14615f..46e31bb4a9ad 100644
--- a/arch/openrisc/include/asm/uaccess.h
+++ b/arch/openrisc/include/asm/uaccess.h
@@ -241,7 +241,7 @@ raw_copy_from_user(void *to, const void __user *from,
unsigned long size)
        return __copy_tofrom_user(to, (__force const void *)from, size);
 }
 static inline unsigned long
-raw_copy_to_user(void *to, const void __user *from, unsigned long size)
+raw_copy_to_user(void __user *to, const void *from, unsigned long size)
 {
        return __copy_tofrom_user((__force void *)to, from, size);
 }
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-07-17 21:24   ` Stafford Horne
@ 2020-07-18  7:02     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-07-18  7:02 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

On Sat, Jul 18, 2020 at 06:24:49AM +0900, Stafford Horne wrote:
> On Fri, Jul 17, 2020 at 06:40:11PM +0200, Christoph Hellwig wrote:
> > As far as I can tell the sparse annotations in the openrisc headers
> > are all messed up, and this is caused by that (just as the other one).
> > 
> > Can you guys drop openriscv sparse runs for now?
> > 
> > Or can the openrisc maintainers tries to fix up the sparse annotations
> > in their uaccess macros?
> > 
> I will have a look at it.  I have this patch on my queue that fixes one issue,
> not sure if its fixes "all" issues, I never used sparse until now.
> 
> I was planning to send this during the 5.9 merge window, but I can send now if
> its urgent.

I don't think it is urgent.  I just try to follow up to buildbot reports
instead of letting them slip.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-18  7:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 14:07 [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces) kernel test robot
2020-07-17 16:40 ` Christoph Hellwig
2020-07-17 21:24   ` Stafford Horne
2020-07-18  7:02     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.