[hare-scsi-devel:tls-upcall.v4 155/156] lib/iov_iter.c:1782:46: sparse: sparse: incorrect type in argument 2 (different address spaces)

From: kernel test robot
Date: Sun Mar 13 2022 - 10:46:11 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git tls-upcall.v4
head: d2416ecdb6b03fc2e4aa40b20cdf919322713224
commit: 921f6399790df513118d6c1aa829d4e9fab5131c [155/156] lib/iov_iter: add hash_iov_iter()
config: microblaze-randconfig-s032-20220313 (https://download.01.org/0day-ci/archive/20220313/202203132257.6GlVo2BL-lkp@xxxxxxxxx/config)
compiler: microblaze-linux-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=921f6399790df513118d6c1aa829d4e9fab5131c
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel tls-upcall.v4
git checkout 921f6399790df513118d6c1aa829d4e9fab5131c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> lib/iov_iter.c:1782:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got void [noderef] __user * @@
lib/iov_iter.c:1782:46: sparse: expected void const *
lib/iov_iter.c:1782:46: sparse: got void [noderef] __user *
lib/iov_iter.c: note: in included file:
include/net/checksum.h:31:39: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __wsum [usertype] sum @@ got unsigned int @@
include/net/checksum.h:31:39: sparse: expected restricted __wsum [usertype] sum
include/net/checksum.h:31:39: sparse: got unsigned int
include/net/checksum.h:39:45: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __wsum [usertype] sum @@ got unsigned int @@
include/net/checksum.h:39:45: sparse: expected restricted __wsum [usertype] sum
include/net/checksum.h:39:45: sparse: got unsigned int

vim +1782 lib/iov_iter.c

1767
1768 size_t hash_iov_iter(void *hashp, const struct iov_iter *i)
1769 {
1770 #ifdef CONFIG_CRYPTO_HASH
1771 struct ahash_request *hash = hashp;
1772 size_t skip = i->iov_offset, size = i->count;
1773 const struct iovec *p;
1774
1775 for (p = i->iov; size; skip = 0, p++) {
1776 struct scatterlist sg;
1777 unsigned offs = offset_in_page(p->iov_base + skip);
1778 size_t len = min(p->iov_len - skip, size);
1779
1780 if (!len)
1781 continue;
> 1782 sg_init_one(&sg, p->iov_base + offs, len);
1783 ahash_request_set_crypt(hash, &sg, NULL, len);
1784 crypto_ahash_update(hash);
1785 size -= len;
1786 }
1787 return i->count;
1788 #else
1789 return 0;
1790 #endif
1791 }
1792 EXPORT_SYMBOL(hash_iov_iter);
1793

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