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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 21 Jun 2020 23:15:35 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jason Wang <jasowang@...hat.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        "Michael S. Tsirkin" <mst@...hat.com>
Subject: drivers/vhost/vhost.c:937:16: sparse: sparse: restricted __virtio16
 degrades to integer

Hi Jason,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   64677779e8962c20b580b471790fe42367750599
commit: 20c384f1ea1a0bc7320bc445c72dd02d2970d594 vhost: refine vhost and vringh kconfig
date:   3 months ago
config: riscv-randconfig-s031-20200621 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-rc2-13-gc59158c8-dirty
        git checkout 20c384f1ea1a0bc7320bc445c72dd02d2970d594
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=riscv CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
>> drivers/vhost/vhost.c:937:16: sparse: sparse: restricted __virtio16 degrades to integer
>> drivers/vhost/vhost.c:937:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:937:16: sparse: sparse: cast from restricted __virtio16
   drivers/vhost/vhost.c:937:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] <asn:1> * @@
   drivers/vhost/vhost.c:937:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:937:16: sparse:     got restricted __virtio16 [noderef] <asn:1> *
>> drivers/vhost/vhost.c:937:16: sparse: sparse: restricted __virtio16 degrades to integer
>> drivers/vhost/vhost.c:937:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:937:16: sparse: sparse: cast from restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:922:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:922:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:922:16: sparse: sparse: cast from restricted __virtio16
   drivers/vhost/vhost.c:922:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] [usertype] <asn:1> * @@
   drivers/vhost/vhost.c:922:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:922:16: sparse:     got restricted __virtio16 [noderef] [usertype] <asn:1> *
   drivers/vhost/vhost.c:922:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:922:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:922:16: sparse: sparse: cast from restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:1014:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1014:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1014:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:1014:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] <asn:1> * @@
   drivers/vhost/vhost.c:1014:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:1014:16: sparse:     got restricted __virtio16 [noderef] <asn:1> *
   drivers/vhost/vhost.c:1014:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1014:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1014:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:989:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:989:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:989:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:989:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] <asn:1> * @@
   drivers/vhost/vhost.c:989:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:989:16: sparse:     got restricted __virtio16 [noderef] <asn:1> *
   drivers/vhost/vhost.c:989:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:989:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:989:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:995:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:995:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:995:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:995:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] <asn:1> * @@
   drivers/vhost/vhost.c:995:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:995:16: sparse:     got restricted __virtio16 [noderef] <asn:1> *
   drivers/vhost/vhost.c:995:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:995:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:995:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:944:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:944:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:944:16: sparse: sparse: cast from restricted __virtio16
   drivers/vhost/vhost.c:944:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] <asn:1> * @@
   drivers/vhost/vhost.c:944:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:944:16: sparse:     got restricted __virtio16 [noderef] <asn:1> *
   drivers/vhost/vhost.c:944:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:944:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:944:16: sparse: sparse: cast from restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:1002:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1002:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1002:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:1002:16: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *addr @@     got restricted __virtio16 [noderef] <asn:1> * @@
   drivers/vhost/vhost.c:1002:16: sparse:     expected void *addr
   drivers/vhost/vhost.c:1002:16: sparse:     got restricted __virtio16 [noderef] <asn:1> *
   drivers/vhost/vhost.c:1002:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1002:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1002:16: sparse: sparse: cast to restricted __virtio16
   drivers/vhost/vhost.c:900:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] <asn:1> *addr @@     got void *addr @@
   drivers/vhost/vhost.c:900:42: sparse:     expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:900:42: sparse:     got void *addr
   drivers/vhost/vhost.c:753:17: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected void [noderef] <asn:1> * @@     got void * @@
   drivers/vhost/vhost.c:753:17: sparse:     expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:753:17: sparse:     got void *
   drivers/vhost/vhost.c:1008:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1008:16: sparse: sparse: restricted __virtio16 degrades to integer
   drivers/vhost/vhost.c:1008:16: sparse: sparse: cast to restricted __virtio16

vim +937 drivers/vhost/vhost.c

7b5d753ebc22c5 Jason Wang 2019-05-24  935  
7b5d753ebc22c5 Jason Wang 2019-05-24  936  {
7b5d753ebc22c5 Jason Wang 2019-05-24 @937  	return vhost_put_user(vq, cpu_to_vhost16(vq, vq->used_flags),
7b5d753ebc22c5 Jason Wang 2019-05-24  938  			      &vq->used->flags);
7b5d753ebc22c5 Jason Wang 2019-05-24  939  }
7b5d753ebc22c5 Jason Wang 2019-05-24  940  

:::::: The code at line 937 was first introduced by commit
:::::: 7b5d753ebc22c5b6935a70ce9a857dc6220784f8 vhost: fine grain userspace memory accessors

:::::: TO: Jason Wang <jasowang@...hat.com>
:::::: CC: Michael S. Tsirkin <mst@...hat.com>

---
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" (25901 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ