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:   Thu, 20 Oct 2022 21:32:46 +0800
From:   kernel test robot <lkp@...el.com>
To:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [kas:lam 5/18] drivers/input/serio/serport.c:235:21: sparse: sparse:
 incorrect type in assignment (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git lam
head:   01819ca3dcb30fc9114025c8c5da8bcee0cabcee
commit: bb9d0488e7c6bfff85581168d4f49f48cd11ac36 [5/18] x86/uaccess: Provide untagged_addr() and remove tags before address check
config: x86_64-randconfig-s023
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git/commit/?id=bb9d0488e7c6bfff85581168d4f49f48cd11ac36
        git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git
        git fetch --no-tags kas lam
        git checkout bb9d0488e7c6bfff85581168d4f49f48cd11ac36
        # 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@...el.com>

sparse warnings: (new ones prefixed by >>)
   drivers/input/serio/serport.c:216:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned long [noderef] __user *__ptr_clean @@     got unsigned long * @@
   drivers/input/serio/serport.c:216:21: sparse:     expected unsigned long [noderef] __user *__ptr_clean
   drivers/input/serio/serport.c:216:21: sparse:     got unsigned long *
>> drivers/input/serio/serport.c:235:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned int [noderef] __user *__ptr_clean @@     got unsigned int * @@
   drivers/input/serio/serport.c:235:21: sparse:     expected unsigned int [noderef] __user *__ptr_clean
   drivers/input/serio/serport.c:235:21: sparse:     got unsigned int *

vim +235 drivers/input/serio/serport.c

a80d8b02751060 John Sung      2014-09-09  225  
a80d8b02751060 John Sung      2014-09-09  226  #ifdef CONFIG_COMPAT
a80d8b02751060 John Sung      2014-09-09  227  #define COMPAT_SPIOCSTYPE	_IOW('q', 0x01, compat_ulong_t)
f0193d3ea73b96 Al Viro        2018-09-13  228  static int serport_ldisc_compat_ioctl(struct tty_struct *tty,
a80d8b02751060 John Sung      2014-09-09  229  				       unsigned int cmd, unsigned long arg)
a80d8b02751060 John Sung      2014-09-09  230  {
a80d8b02751060 John Sung      2014-09-09  231  	if (cmd == COMPAT_SPIOCSTYPE) {
a80d8b02751060 John Sung      2014-09-09  232  		void __user *uarg = compat_ptr(arg);
a80d8b02751060 John Sung      2014-09-09  233  		compat_ulong_t compat_type;
a80d8b02751060 John Sung      2014-09-09  234  
a80d8b02751060 John Sung      2014-09-09 @235  		if (get_user(compat_type, (compat_ulong_t __user *)uarg))
a80d8b02751060 John Sung      2014-09-09  236  			return -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16  237  
a80d8b02751060 John Sung      2014-09-09  238  		serport_set_type(tty, compat_type);
^1da177e4c3f41 Linus Torvalds 2005-04-16  239  		return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  240  	}
^1da177e4c3f41 Linus Torvalds 2005-04-16  241  
^1da177e4c3f41 Linus Torvalds 2005-04-16  242  	return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16  243  }
a80d8b02751060 John Sung      2014-09-09  244  #endif
^1da177e4c3f41 Linus Torvalds 2005-04-16  245  

:::::: The code at line 235 was first introduced by commit
:::::: a80d8b02751060a178bb1f7a6b7a93645a7a308b Input: serport - add compat handling for SPIOCSTYPE ioctl

:::::: TO: John Sung <penmount.touch@...il.com>
:::::: CC: Dmitry Torokhov <dmitry.torokhov@...il.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (122295 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ