All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [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 22:07:06 +0800	[thread overview]
Message-ID: <202007172203.hFaTOOHm%lkp@intel.com> (raw)

[-- 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 --]

             reply	other threads:[~2020-07-17 14:07 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202007172203.hFaTOOHm%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.