[linux-next:master 13726/14198] lib/iov_iter.c:1815:9: sparse: sparse: incorrect type in argument 2 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d3fde8ff50ab265749704bd7fbcf70d35235421f
commit: 15c8a3b370909a43c03bb937a373921ee92be65a [13726/14198] iov_iter: Add a general purpose iteration function
config: x86_64-randconfig-s021 (https://download.01.org/0day-ci/archive/20220528/202205280944.JM8XsoYY-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-14-g5a0004b5-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=15c8a3b370909a43c03bb937a373921ee92be65a
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 15c8a3b370909a43c03bb937a373921ee92be65a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> lib/iov_iter.c:1815:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *p @@     got void [noderef] __user *[assigned] base @@
   lib/iov_iter.c:1815:9: sparse:     expected void const *p
   lib/iov_iter.c:1815:9: sparse:     got void [noderef] __user *[assigned] base

vim +1815 lib/iov_iter.c

  1791	
  1792	/**
  1793	 * iov_iter_scan - Scan a source iter
  1794	 * @i: The iterator to scan
  1795	 * @bytes: The amount of buffer/data to scan
  1796	 * @scanner: The function to call for each bit
  1797	 * @priv: Private data to pass to the scanner function
  1798	 *
  1799	 * Scan an iterator, passing each segment to the scanner function.  If the
  1800	 * scanner returns an error at any time, scanning stops and the error is
  1801	 * returned, otherwise the sum of the scanner results is returned.
  1802	 */
  1803	ssize_t iov_iter_scan(struct iov_iter *i, size_t bytes,
  1804			      ssize_t (*scanner)(struct iov_iter *i, const void *p,
  1805						 size_t len, size_t off, void *priv),
  1806			      void *priv)
  1807	{
  1808		ssize_t ret = 0, scanned = 0;
  1809	
  1810		if (!bytes)
  1811			return 0;
  1812		if (iter_is_iovec(i))
  1813			might_fault();
  1814	
> 1815		iterate_and_advance(
  1816			i, bytes, base, len, off, ({
  1817					ret = scanner(i, base, len, off, priv);
  1818					if (ret < 0)
  1819						break;
  1820					scanned += ret;
  1821				}), ({
  1822					ret = scanner(i, base, len, off, priv);
  1823					if (ret < 0)
  1824						break;
  1825					scanned += ret;
  1826				})
  1827		);
  1828		return ret < 0 ? ret : scanned;
  1829	}
  1830	EXPORT_SYMBOL(iov_iter_scan);
  1831	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux