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]
Message-ID: <202202131259.S6ZP2d9J-lkp@intel.com>
Date:   Sun, 13 Feb 2022 12:43:35 +0800
From:   kernel test robot <lkp@...el.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [arnd-playground:set_fs 2/11] mm/maccess.c:37:17: sparse: sparse:
 cast removes address space '__user' of expression

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git set_fs
head:   0a081326831928b0d739bce68b8c0f9138b9c8ba
commit: 872ec1b8b0c531c0367aa6f365149bf70d3bcd30 [2/11] sparc64: add __{get,put}_kernel_nocheck()
config: sparc64-randconfig-s032-20220213 (https://download.01.org/0day-ci/archive/20220213/202202131259.S6ZP2d9J-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?id=872ec1b8b0c531c0367aa6f365149bf70d3bcd30
        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 872ec1b8b0c531c0367aa6f365149bf70d3bcd30
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc64 SHELL=/bin/bash

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 >>)
>> mm/maccess.c:37:17: sparse: sparse: cast removes address space '__user' of expression
>> mm/maccess.c:37:17: sparse: sparse: cast removes address space '__user' of expression
>> mm/maccess.c:37:17: sparse: sparse: cast removes address space '__user' of expression
>> mm/maccess.c:37:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:39:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:39:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:39:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:39:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:41:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:41:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:41:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:41:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:42:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:42:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:42:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:42:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:68:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:68:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:68:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:68:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:70:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:70:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:70:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:70:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:72:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:72:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:72:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:72:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:73:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:73:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:73:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:73:9: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:92:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:92:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:92:17: sparse: sparse: cast removes address space '__user' of expression
   mm/maccess.c:92:17: sparse: sparse: cast removes address space '__user' of expression

vim +/__user +37 mm/maccess.c

b58294ead14cde Christoph Hellwig 2020-06-08  16  
fe557319aa06c2 Christoph Hellwig 2020-06-17  17  #define copy_from_kernel_nofault_loop(dst, src, len, type, err_label)	\
b58294ead14cde Christoph Hellwig 2020-06-08  18  	while (len >= sizeof(type)) {					\
b58294ead14cde Christoph Hellwig 2020-06-08  19  		__get_kernel_nofault(dst, src, type, err_label);		\
b58294ead14cde Christoph Hellwig 2020-06-08  20  		dst += sizeof(type);					\
b58294ead14cde Christoph Hellwig 2020-06-08  21  		src += sizeof(type);					\
b58294ead14cde Christoph Hellwig 2020-06-08  22  		len -= sizeof(type);					\
b58294ead14cde Christoph Hellwig 2020-06-08  23  	}
b58294ead14cde Christoph Hellwig 2020-06-08  24  
fe557319aa06c2 Christoph Hellwig 2020-06-17  25  long copy_from_kernel_nofault(void *dst, const void *src, size_t size)
b58294ead14cde Christoph Hellwig 2020-06-08  26  {
2423de2e6f4d86 Arnd Bergmann     2021-08-11  27  	unsigned long align = 0;
2423de2e6f4d86 Arnd Bergmann     2021-08-11  28  
2423de2e6f4d86 Arnd Bergmann     2021-08-11  29  	if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS))
2423de2e6f4d86 Arnd Bergmann     2021-08-11  30  		align = (unsigned long)dst | (unsigned long)src;
2423de2e6f4d86 Arnd Bergmann     2021-08-11  31  
fe557319aa06c2 Christoph Hellwig 2020-06-17  32  	if (!copy_from_kernel_nofault_allowed(src, size))
2a71e81d321987 Christoph Hellwig 2020-06-08  33  		return -ERANGE;
b58294ead14cde Christoph Hellwig 2020-06-08  34  
b58294ead14cde Christoph Hellwig 2020-06-08  35  	pagefault_disable();
2423de2e6f4d86 Arnd Bergmann     2021-08-11  36  	if (!(align & 7))
fe557319aa06c2 Christoph Hellwig 2020-06-17 @37  		copy_from_kernel_nofault_loop(dst, src, size, u64, Efault);
2423de2e6f4d86 Arnd Bergmann     2021-08-11  38  	if (!(align & 3))
fe557319aa06c2 Christoph Hellwig 2020-06-17  39  		copy_from_kernel_nofault_loop(dst, src, size, u32, Efault);
2423de2e6f4d86 Arnd Bergmann     2021-08-11  40  	if (!(align & 1))
fe557319aa06c2 Christoph Hellwig 2020-06-17  41  		copy_from_kernel_nofault_loop(dst, src, size, u16, Efault);
fe557319aa06c2 Christoph Hellwig 2020-06-17  42  	copy_from_kernel_nofault_loop(dst, src, size, u8, Efault);
b58294ead14cde Christoph Hellwig 2020-06-08  43  	pagefault_enable();
b58294ead14cde Christoph Hellwig 2020-06-08  44  	return 0;
b58294ead14cde Christoph Hellwig 2020-06-08  45  Efault:
b58294ead14cde Christoph Hellwig 2020-06-08  46  	pagefault_enable();
b58294ead14cde Christoph Hellwig 2020-06-08  47  	return -EFAULT;
b58294ead14cde Christoph Hellwig 2020-06-08  48  }
fe557319aa06c2 Christoph Hellwig 2020-06-17  49  EXPORT_SYMBOL_GPL(copy_from_kernel_nofault);
b58294ead14cde Christoph Hellwig 2020-06-08  50  

:::::: The code at line 37 was first introduced by commit
:::::: fe557319aa06c23cffc9346000f119547e0f289a maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault

:::::: TO: Christoph Hellwig <hch@....de>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ