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, 18 Jun 2020 07:20:37 +0800
From:   kernel test robot <lkp@...el.com>
To:     Martin Hundebøll <martin@...nix.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: drivers/tty/n_gsm.c:2630:24: sparse: sparse: incorrect type in
 initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1b5044021070efa3259f3e9548dc35d1eb6aa844
commit: a7b121b4b8b0bcc14fc1c2a81d34096109a65dd6 tty: n_gsm: add ioctl to map serial device to mux'ed tty
date:   10 months ago
config: openrisc-randconfig-s032-20200617 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-rc1-6-g78f577f8-dirty
        git checkout a7b121b4b8b0bcc14fc1c2a81d34096109a65dd6
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=openrisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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 >>)

>> include/linux/unaligned/le_byteshift.h:25:16: sparse: sparse: cast truncates bits from constant value (f00d becomes d)
>> include/linux/unaligned/le_byteshift.h:32:30: sparse: sparse: cast truncates bits from constant value (f00dface becomes face)
>> include/linux/unaligned/le_byteshift.h:25:16: sparse: sparse: cast truncates bits from constant value (face becomes ce)
>> include/linux/unaligned/le_byteshift.h:25:16: sparse: sparse: cast truncates bits from constant value (f00d becomes d)
>> include/linux/unaligned/le_byteshift.h:32:30: sparse: sparse: cast truncates bits from constant value (f00dface becomes face)
>> include/linux/unaligned/le_byteshift.h:25:16: sparse: sparse: cast truncates bits from constant value (face becomes ce)
--
   drivers/tty/n_gsm.c:2621:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] <asn:1> *to @@     got void * @@
   drivers/tty/n_gsm.c:2621:35: sparse:     expected void [noderef] <asn:1> *to
   drivers/tty/n_gsm.c:2621:35: sparse:     got void *
   drivers/tty/n_gsm.c:2625:41: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] <asn:1> *from @@     got void * @@
   drivers/tty/n_gsm.c:2625:41: sparse:     expected void const [noderef] <asn:1> *from
   drivers/tty/n_gsm.c:2625:41: sparse:     got void *
>> drivers/tty/n_gsm.c:2630:24: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int *__pu_addr @@     got unsigned int [noderef] [usertype] <asn:1> * @@
>> drivers/tty/n_gsm.c:2630:24: sparse:     expected unsigned int *__pu_addr
   drivers/tty/n_gsm.c:2630:24: sparse:     got unsigned int [noderef] [usertype] <asn:1> *
   drivers/tty/n_gsm.c:2795:29: sparse: sparse: restricted __be16 degrades to integer
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] <asn:1> *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] <asn:1> *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] <asn:1> *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] <asn:1> *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] <asn:1> *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] <asn:1> *from
   include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got void [noderef] <asn:1> *to @@
   include/linux/uaccess.h:131:38: sparse:     expected void *to
   include/linux/uaccess.h:131:38: sparse:     got void [noderef] <asn:1> *to
   include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] <asn:1> *from @@     got void const *from @@
   include/linux/uaccess.h:131:42: sparse:     expected void const [noderef] <asn:1> *from
   include/linux/uaccess.h:131:42: sparse:     got void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got void const [noderef] <asn:1> *from @@
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     expected void const *from
   arch/openrisc/include/asm/uaccess.h:246:55: sparse:     got void const [noderef] <asn:1> *from

vim +2630 drivers/tty/n_gsm.c

  2610	
  2611	static int gsmld_ioctl(struct tty_struct *tty, struct file *file,
  2612			       unsigned int cmd, unsigned long arg)
  2613	{
  2614		struct gsm_config c;
  2615		struct gsm_mux *gsm = tty->disc_data;
  2616		unsigned int base;
  2617	
  2618		switch (cmd) {
  2619		case GSMIOC_GETCONF:
  2620			gsm_copy_config_values(gsm, &c);
  2621			if (copy_to_user((void *)arg, &c, sizeof(c)))
  2622				return -EFAULT;
  2623			return 0;
  2624		case GSMIOC_SETCONF:
  2625			if (copy_from_user(&c, (void *)arg, sizeof(c)))
  2626				return -EFAULT;
  2627			return gsm_config(gsm, &c);
  2628		case GSMIOC_GETFIRST:
  2629			base = mux_num_to_base(gsm);
> 2630			return put_user(base + 1, (__u32 __user *)arg);
  2631		default:
  2632			return n_tty_ioctl_helper(tty, file, cmd, arg);
  2633		}
  2634	}
  2635	

---
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" (24549 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ