From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8247329816612363467==" MIME-Version: 1.0 From: Christoph Hellwig To: kbuild-all@lists.01.org Subject: Re: [hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces) Date: Fri, 17 Jul 2020 18:40:11 +0200 Message-ID: <20200717164011.GA17943@lst.de> In-Reply-To: <202007172203.hFaTOOHm%lkp@intel.com> List-Id: --===============8247329816612363467== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/sbi= n/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=3D$HOME/0day COMPILER=3Dgcc-9.3.0 make.cros= s C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=3Dopenrisc = > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > = > sparse warnings: (new ones prefixed by >>) > = > net/ipv4/ip_sockglue.c:908:29: sparse: sparse: incorrect type in initi= alizer (different address spaces) @@ expected int const *__gu_addr @@ = got int [noderef] __user * @@ > net/ipv4/ip_sockglue.c:908:29: sparse: expected int const *__gu_ad= dr > net/ipv4/ip_sockglue.c:908:29: sparse: got int [noderef] __user * > net/ipv4/ip_sockglue.c:913:29: sparse: sparse: incorrect type in initi= alizer (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 cons= t *__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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected unsigned int *__pu_addr = @@ got unsigned int [noderef] __user * @@ > >> net/ipv4/ip_sockglue.c:1489:13: sparse: expected unsigned int *__p= u_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 init= ializer (different address spaces) @@ expected unsigned int *__pu_addr = @@ got unsigned int [noderef] __user * @@ > net/ipv4/ip_sockglue.c:1490:13: sparse: expected unsigned int *__p= u_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 init= ializer (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_a= ddr > 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 init= ializer (different address spaces) @@ expected int *__pu_addr @@ go= t 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 argu= ment 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 argu= ment 2 (different address spaces) @@ expected void const [noderef] __us= er *from @@ got void const *from @@ > include/linux/uaccess.h:131:42: sparse: expected void const [noder= ef] __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 *f= rom @@ 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 argu= ment 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 argu= ment 2 (different address spaces) @@ expected void const [noderef] __us= er *from @@ got void const *from @@ > include/linux/uaccess.h:131:42: sparse: expected void const [noder= ef] __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 *f= rom @@ 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 argu= ment 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 argu= ment 2 (different address spaces) @@ expected void const [noderef] __us= er *from @@ got void const *from @@ > include/linux/uaccess.h:131:42: sparse: expected void const [noder= ef] __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 *f= rom @@ 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 argu= ment 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 argu= ment 2 (different address spaces) @@ expected void const [noderef] __us= er *from @@ got void const *from @@ > include/linux/uaccess.h:131:42: sparse: expected void const [noder= ef] __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 *f= rom @@ 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 argu= ment 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 argu= ment 2 (different address spaces) @@ expected void const [noderef] __us= er *from @@ got void const *from @@ > include/linux/uaccess.h:131:42: sparse: expected void const [noder= ef] __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 *f= rom @@ 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 =3D = offsetof(struct compat_group_filter, gf_slist); > 4aa551d47237465 Christoph Hellwig 2020-07-15 1466 struct compat_group_= filter __user *p =3D 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 =3D = gf32.gf_interface; > 4aa551d47237465 Christoph Hellwig 2020-07-15 1478 gf.gf_fmode =3D gf32= .gf_fmode; > 4aa551d47237465 Christoph Hellwig 2020-07-15 1479 num =3D gf.gf_numsrc= =3D gf32.gf_numsrc; > 4aa551d47237465 Christoph Hellwig 2020-07-15 1480 gf.gf_group =3D gf32= .gf_group; > 4aa551d47237465 Christoph Hellwig 2020-07-15 1481 = > 4aa551d47237465 Christoph Hellwig 2020-07-15 1482 err =3D 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 < n= um) > 4aa551d47237465 Christoph Hellwig 2020-07-15 1486 num =3D gf.gf_numsr= c; > 4aa551d47237465 Christoph Hellwig 2020-07-15 1487 len =3D GROUP_FILTER= _SIZE(num) - (sizeof(gf) - sizeof(gf32)); > 4aa551d47237465 Christoph Hellwig 2020-07-15 1488 if (put_user(len, op= tlen) || > 4aa551d47237465 Christoph Hellwig 2020-07-15 @1489 put_user(gf.gf_f= mode, &p->gf_fmode) || > 4aa551d47237465 Christoph Hellwig 2020-07-15 1490 put_user(gf.gf_n= umsrc, &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 MCAS= T_MSFILTER getsockopt helpers > = > :::::: TO: Christoph Hellwig > :::::: CC: Christoph Hellwig > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org ---end quoted text--- --===============8247329816612363467==--