From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Steve French <stfrench@microsoft.com>
Subject: [linux-next:master 13726/14198] lib/iov_iter.c:1815:9: sparse: sparse: incorrect type in argument 2 (different address spaces)
Date: Sat, 28 May 2022 09:12:54 +0800 [thread overview]
Message-ID: <202205280944.JM8XsoYY-lkp@intel.com> (raw)
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@intel.com/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@intel.com>
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
reply other threads:[~2022-05-28 1:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202205280944.JM8XsoYY-lkp@intel.com \
--to=lkp@intel.com \
--cc=dhowells@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=stfrench@microsoft.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).