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>] [day] [month] [year] [list]
Date:   Tue, 28 Jul 2020 12:02:07 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/net/hamradio/6pack.c:706:23: sparse: sparse: incorrect type
 in initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92ed301919932f777713b9172e525674157e983d
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   6 weeks ago
config: openrisc-randconfig-s031-20200728 (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-94-geb6779f6-dirty
        git checkout 670d0a4b10704667765f7d18f7592993d02783aa
        # 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@...el.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/net/hamradio/6pack.c:706:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int *__pu_addr @@     got int [noderef] __user * @@
   drivers/net/hamradio/6pack.c:706:23: sparse:     expected int *__pu_addr
>> drivers/net/hamradio/6pack.c:706:23: sparse:     got int [noderef] __user *
>> drivers/net/hamradio/6pack.c:710:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   drivers/net/hamradio/6pack.c:710:21: sparse:     expected int const *__gu_addr
   drivers/net/hamradio/6pack.c:710:21: sparse:     got int [noderef] __user *
   drivers/net/hamradio/6pack.c: note: in included file:
   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
   drivers/net/hamradio/6pack.c: note: in included file (through include/linux/uaccess.h):
   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
--
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   net/bluetooth/rfcomm/sock.c:659:21: sparse:     expected unsigned int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:659:21: sparse:     got unsigned int [noderef] [usertype] __user *
   net/bluetooth/rfcomm/sock.c:735:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   net/bluetooth/rfcomm/sock.c:735:21: sparse:     expected unsigned int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:735:21: sparse:     got unsigned int [noderef] [usertype] __user *
   net/bluetooth/rfcomm/sock.c:767:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *optlen @@
   net/bluetooth/rfcomm/sock.c:767:13: sparse:     expected int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:767:13: sparse:     got int [noderef] __user *optlen
   net/bluetooth/rfcomm/sock.c:797:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   net/bluetooth/rfcomm/sock.c:797:21: sparse:     expected unsigned int *__pu_addr
   net/bluetooth/rfcomm/sock.c:797:21: sparse:     got unsigned int [noderef] [usertype] __user *
   net/bluetooth/rfcomm/sock.c:845:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *optlen @@
   net/bluetooth/rfcomm/sock.c:845:13: sparse:     expected int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:845:13: sparse:     got int [noderef] __user *optlen
   net/bluetooth/rfcomm/sock.c:872:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   net/bluetooth/rfcomm/sock.c:872:21: sparse:     expected unsigned int *__pu_addr
   net/bluetooth/rfcomm/sock.c:872:21: sparse:     got unsigned int [noderef] [usertype] __user *
   net/bluetooth/rfcomm/sock.c: note: in included file (through include/linux/crypto.h, include/crypto/hash.h, include/linux/uio.h, ...):
   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
   net/bluetooth/rfcomm/sock.c: note: in included file (through include/linux/uaccess.h, include/linux/crypto.h, include/crypto/hash.h, ...):
   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
   net/bluetooth/rfcomm/sock.c: note: in included file (through include/linux/crypto.h, include/crypto/hash.h, include/linux/uio.h, ...):
   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
   net/bluetooth/rfcomm/sock.c: note: in included file (through include/linux/uaccess.h, include/linux/crypto.h, include/crypto/hash.h, ...):
   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
--
>> drivers/net/can/sja1000/ems_pcmcia.c:151:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] __iomem *base_addr @@
   drivers/net/can/sja1000/ems_pcmcia.c:151:21: sparse:     expected void *addr
>> drivers/net/can/sja1000/ems_pcmcia.c:151:21: sparse:     got void [noderef] __iomem *base_addr
   drivers/net/can/sja1000/ems_pcmcia.c: note: in included file (through arch/openrisc/include/asm/io.h, include/linux/io.h, include/linux/irq.h, ...):
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
   include/asm-generic/io.h:166:15: sparse: sparse: cast to restricted __le16
--
>> drivers/net/can/sja1000/sja1000_isa.c:214:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] __iomem *[assigned] base @@
   drivers/net/can/sja1000/sja1000_isa.c:214:25: sparse:     expected void *addr
>> drivers/net/can/sja1000/sja1000_isa.c:214:25: sparse:     got void [noderef] __iomem *[assigned] base
>> drivers/net/can/sja1000/sja1000_isa.c:233:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] __iomem *reg_base @@
   drivers/net/can/sja1000/sja1000_isa.c:233:29: sparse:     expected void *addr
>> drivers/net/can/sja1000/sja1000_isa.c:233:29: sparse:     got void [noderef] __iomem *reg_base

vim +706 drivers/net/hamradio/6pack.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  686  
^1da177e4c3f41 Linus Torvalds 2005-04-16  687  /* Perform I/O control on an active 6pack channel. */
^1da177e4c3f41 Linus Torvalds 2005-04-16  688  static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
^1da177e4c3f41 Linus Torvalds 2005-04-16  689  	unsigned int cmd, unsigned long arg)
^1da177e4c3f41 Linus Torvalds 2005-04-16  690  {
^1da177e4c3f41 Linus Torvalds 2005-04-16  691  	struct sixpack *sp = sp_get(tty);
0397a2648434a6 Julia Lawall   2009-01-09  692  	struct net_device *dev;
^1da177e4c3f41 Linus Torvalds 2005-04-16  693  	unsigned int tmp, err;
^1da177e4c3f41 Linus Torvalds 2005-04-16  694  
^1da177e4c3f41 Linus Torvalds 2005-04-16  695  	if (!sp)
^1da177e4c3f41 Linus Torvalds 2005-04-16  696  		return -ENXIO;
0397a2648434a6 Julia Lawall   2009-01-09  697  	dev = sp->dev;
^1da177e4c3f41 Linus Torvalds 2005-04-16  698  
^1da177e4c3f41 Linus Torvalds 2005-04-16  699  	switch(cmd) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  700  	case SIOCGIFNAME:
^1da177e4c3f41 Linus Torvalds 2005-04-16  701  		err = copy_to_user((void __user *) arg, dev->name,
^1da177e4c3f41 Linus Torvalds 2005-04-16  702  		                   strlen(dev->name) + 1) ? -EFAULT : 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  703  		break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  704  
^1da177e4c3f41 Linus Torvalds 2005-04-16  705  	case SIOCGIFENCAP:
^1da177e4c3f41 Linus Torvalds 2005-04-16 @706  		err = put_user(0, (int __user *) arg);
^1da177e4c3f41 Linus Torvalds 2005-04-16  707  		break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  708  
^1da177e4c3f41 Linus Torvalds 2005-04-16  709  	case SIOCSIFENCAP:
^1da177e4c3f41 Linus Torvalds 2005-04-16 @710  		if (get_user(tmp, (int __user *) arg)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  711  			err = -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16  712  			break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  713  		}
^1da177e4c3f41 Linus Torvalds 2005-04-16  714  
^1da177e4c3f41 Linus Torvalds 2005-04-16  715  		sp->mode = tmp;
^1da177e4c3f41 Linus Torvalds 2005-04-16  716  		dev->addr_len        = AX25_ADDR_LEN;
^1da177e4c3f41 Linus Torvalds 2005-04-16  717  		dev->hard_header_len = AX25_KISS_HEADER_LEN +
^1da177e4c3f41 Linus Torvalds 2005-04-16  718  		                       AX25_MAX_HEADER_LEN + 3;
^1da177e4c3f41 Linus Torvalds 2005-04-16  719  		dev->type            = ARPHRD_AX25;
^1da177e4c3f41 Linus Torvalds 2005-04-16  720  
^1da177e4c3f41 Linus Torvalds 2005-04-16  721  		err = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  722  		break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  723  
^1da177e4c3f41 Linus Torvalds 2005-04-16  724  	 case SIOCSIFHWADDR: {
^1da177e4c3f41 Linus Torvalds 2005-04-16  725  		char addr[AX25_ADDR_LEN];
^1da177e4c3f41 Linus Torvalds 2005-04-16  726  
^1da177e4c3f41 Linus Torvalds 2005-04-16  727  		if (copy_from_user(&addr,
^1da177e4c3f41 Linus Torvalds 2005-04-16  728  		                   (void __user *) arg, AX25_ADDR_LEN)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  729  				err = -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16  730  				break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  731  			}
^1da177e4c3f41 Linus Torvalds 2005-04-16  732  
932ff279a43ab7 Herbert Xu     2006-06-09  733  			netif_tx_lock_bh(dev);
^1da177e4c3f41 Linus Torvalds 2005-04-16  734  			memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN);
932ff279a43ab7 Herbert Xu     2006-06-09  735  			netif_tx_unlock_bh(dev);
^1da177e4c3f41 Linus Torvalds 2005-04-16  736  
^1da177e4c3f41 Linus Torvalds 2005-04-16  737  			err = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  738  			break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  739  		}
^1da177e4c3f41 Linus Torvalds 2005-04-16  740  
^1da177e4c3f41 Linus Torvalds 2005-04-16  741  	default:
d0127539ea9b5f Alan Cox       2007-11-07  742  		err = tty_mode_ioctl(tty, file, cmd, arg);
^1da177e4c3f41 Linus Torvalds 2005-04-16  743  	}
^1da177e4c3f41 Linus Torvalds 2005-04-16  744  
^1da177e4c3f41 Linus Torvalds 2005-04-16  745  	sp_put(sp);
^1da177e4c3f41 Linus Torvalds 2005-04-16  746  
^1da177e4c3f41 Linus Torvalds 2005-04-16  747  	return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16  748  }
^1da177e4c3f41 Linus Torvalds 2005-04-16  749  

:::::: The code at line 706 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.org>

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

Download attachment ".config.gz" of type "application/gzip" (20078 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ