public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Subject: arch/arm/kernel/traps.c:177:31: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Wed, 11 Aug 2021 11:19:32 +0800	[thread overview]
Message-ID: <202108111113.7qa0drb3-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5448 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9e723c5380c6e14fb91a8b6950563d040674afdb
commit: e5fc436f06eef54ef512ea55a9db8eb9f2e76959 sparse: use static inline for __chk_{user,io}_ptr()
date:   12 months ago
config: arm-randconfig-s031-20210810 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.3.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.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5fc436f06eef54ef512ea55a9db8eb9f2e76959
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e5fc436f06eef54ef512ea55a9db8eb9f2e76959
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm 

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 >>)
   arch/arm/kernel/traps.c:148:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long * @@
   arch/arm/kernel/traps.c:148:37: sparse:     expected void const volatile [noderef] __user *ptr
   arch/arm/kernel/traps.c:148:37: sparse:     got unsigned long *
>> arch/arm/kernel/traps.c:177:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned short [usertype] * @@
   arch/arm/kernel/traps.c:177:31: sparse:     expected void const volatile [noderef] __user *ptr
   arch/arm/kernel/traps.c:177:31: sparse:     got unsigned short [usertype] *
>> arch/arm/kernel/traps.c:179:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   arch/arm/kernel/traps.c:179:31: sparse:     expected void const volatile [noderef] __user *ptr
   arch/arm/kernel/traps.c:179:31: sparse:     got unsigned int [usertype] *
   arch/arm/kernel/traps.c:455:33: sparse: sparse: cast removes address space '__user' of expression
   arch/arm/kernel/traps.c:458:41: sparse: sparse: cast removes address space '__user' of expression
   arch/arm/kernel/traps.c:463:33: sparse: sparse: cast removes address space '__user' of expression
   arch/arm/kernel/traps.c:775:6: sparse: sparse: symbol 'abort' was not declared. Should it be static?

vim +177 arch/arm/kernel/traps.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  159  
b9dd05c7002ee0 Mark Rutland   2017-11-02  160  static void __dump_instr(const char *lvl, struct pt_regs *regs)
^1da177e4c3f41 Linus Torvalds 2005-04-16  161  {
^1da177e4c3f41 Linus Torvalds 2005-04-16  162  	unsigned long addr = instruction_pointer(regs);
^1da177e4c3f41 Linus Torvalds 2005-04-16  163  	const int thumb = thumb_mode(regs);
^1da177e4c3f41 Linus Torvalds 2005-04-16  164  	const int width = thumb ? 4 : 8;
d191fe093f4494 Russell King   2009-10-11  165  	char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
^1da177e4c3f41 Linus Torvalds 2005-04-16  166  	int i;
^1da177e4c3f41 Linus Torvalds 2005-04-16  167  
^1da177e4c3f41 Linus Torvalds 2005-04-16  168  	/*
b9dd05c7002ee0 Mark Rutland   2017-11-02  169  	 * Note that we now dump the code first, just in case the backtrace
b9dd05c7002ee0 Mark Rutland   2017-11-02  170  	 * kills us.
^1da177e4c3f41 Linus Torvalds 2005-04-16  171  	 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  172  
a9011580a99cd4 Russell King   2011-06-09  173  	for (i = -4; i < 1 + !!thumb; i++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  174  		unsigned int val, bad;
^1da177e4c3f41 Linus Torvalds 2005-04-16  175  
^1da177e4c3f41 Linus Torvalds 2005-04-16  176  		if (thumb)
b9dd05c7002ee0 Mark Rutland   2017-11-02 @177  			bad = get_user(val, &((u16 *)addr)[i]);
^1da177e4c3f41 Linus Torvalds 2005-04-16  178  		else
b9dd05c7002ee0 Mark Rutland   2017-11-02 @179  			bad = get_user(val, &((u32 *)addr)[i]);
^1da177e4c3f41 Linus Torvalds 2005-04-16  180  
^1da177e4c3f41 Linus Torvalds 2005-04-16  181  		if (!bad)
d191fe093f4494 Russell King   2009-10-11  182  			p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
d191fe093f4494 Russell King   2009-10-11  183  					width, val);
^1da177e4c3f41 Linus Torvalds 2005-04-16  184  		else {
d191fe093f4494 Russell King   2009-10-11  185  			p += sprintf(p, "bad PC value");
^1da177e4c3f41 Linus Torvalds 2005-04-16  186  			break;
^1da177e4c3f41 Linus Torvalds 2005-04-16  187  		}
^1da177e4c3f41 Linus Torvalds 2005-04-16  188  	}
e40c2ec6761d11 Russell King   2009-10-11  189  	printk("%sCode: %s\n", lvl, str);
b9dd05c7002ee0 Mark Rutland   2017-11-02  190  }
^1da177e4c3f41 Linus Torvalds 2005-04-16  191  

:::::: The code at line 177 was first introduced by commit
:::::: b9dd05c7002ee0ca8b676428b2268c26399b5e31 ARM: 8720/1: ensure dump_instr() checks addr_limit

:::::: TO: Mark Rutland <mark.rutland@arm.com>
:::::: CC: Russell King <rmk+kernel@armlinux.org.uk>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28855 bytes --]

                 reply	other threads:[~2021-08-11  3:20 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=202108111113.7qa0drb3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=miguel.ojeda.sandonis@gmail.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