From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [arnd-playground:set_fs 6/11] lib/test_lockup.c:420:13: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Sun, 13 Feb 2022 15:37:45 +0800 [thread overview]
Message-ID: <202202131523.w4Vvi8jc-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git set_fs
head: 0a081326831928b0d739bce68b8c0f9138b9c8ba
commit: a954036380ae20dbfa0c203bf6cafb21d1f3cedd [6/11] uaccess: generalize access_ok()
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220213/202202131523.w4Vvi8jc-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?id=a954036380ae20dbfa0c203bf6cafb21d1f3cedd
git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground set_fs
git checkout a954036380ae20dbfa0c203bf6cafb21d1f3cedd
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> lib/test_lockup.c:420:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user *ptr @@ got void *ptr @@
lib/test_lockup.c:420:13: sparse: expected void const [noderef] __user *ptr
lib/test_lockup.c:420:13: sparse: got void *ptr
>> lib/test_lockup.c:421:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user *ptr @@ got void * @@
lib/test_lockup.c:421:13: sparse: expected void const [noderef] __user *ptr
lib/test_lockup.c:421:13: sparse: got void *
lib/test_lockup.c:230:9: sparse: sparse: context imbalance in 'test_lock' - wrong count at exit
lib/test_lockup.c:250:25: sparse: sparse: context imbalance in 'test_unlock' - unexpected unlock
vim +420 lib/test_lockup.c
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 410
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 411 static bool test_kernel_ptr(unsigned long addr, int size)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 412 {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 413 void *ptr = (void *)addr;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 414 char buf;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 415
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 416 if (!addr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 417 return false;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 418
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 419 /* should be at least readable kernel address */
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @420 if (access_ok(ptr, 1) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @421 access_ok(ptr + size - 1, 1) ||
25f12ae45fc193 Christoph Hellwig 2020-06-17 422 get_kernel_nofault(buf, ptr) ||
25f12ae45fc193 Christoph Hellwig 2020-06-17 423 get_kernel_nofault(buf, ptr + size - 1)) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 424 pr_err("invalid kernel ptr: %#lx\n", addr);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 425 return true;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 426 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 427
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 428 return false;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 429 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 430
:::::: The code at line 420 was first introduced by commit
:::::: 30428ef5d1e8caf78639cc70a802f1cb7b1cec04 lib/test_lockup: test module to generate lockups
:::::: TO: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
reply other threads:[~2022-02-13 7:38 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=202202131523.w4Vvi8jc-lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@arndb.de \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
/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