lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 11 Aug 2021 11:19:32 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Subject: arch/arm/kernel/traps.c:177:31: sparse: sparse: incorrect type in
 argument 1 (different address spaces)

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@...el.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@....com>
:::::: CC: Russell King <rmk+kernel@...linux.org.uk>

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

Download attachment ".config.gz" of type "application/gzip" (28855 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ