[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007140452.jSEnaqaB%lkp@intel.com>
Date: Tue, 14 Jul 2020 04:16:57 +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
Subject: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1483:13:
sparse: sparse: cast removes address space '__user' of expression
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 11ba468877bb23f28956a35e896356252d63c983
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 4 weeks ago
config: powerpc-randconfig-s032-20200714 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.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.2-37-gc9676a3b-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc
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 >>)
>> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1483:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1485:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1611:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1613:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1688:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1691:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1738:13: sparse: sparse: cast removes address space '__user' of expression
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1768:59: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *uptr @@ got struct vchiq_header *[addressable] header @@
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1768:59: sparse: expected void [noderef] __user *uptr
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1768:59: sparse: got struct vchiq_header *[addressable] header
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1770:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *uptr @@ got void *[addressable] service_userdata @@
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1770:45: sparse: expected void [noderef] __user *uptr
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1770:45: sparse: got void *[addressable] service_userdata
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1772:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *uptr @@ got void *[addressable] bulk_userdata @@
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1772:45: sparse: expected void [noderef] __user *uptr
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1772:45: sparse: got void *[addressable] bulk_userdata
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1826:13: sparse: sparse: cast removes address space '__user' of expression
--
>> drivers/rpmsg/qcom_glink_smem.c:93:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *s @@ got void * @@
>> drivers/rpmsg/qcom_glink_smem.c:93:48: sparse: expected void const volatile [noderef] __iomem *s
drivers/rpmsg/qcom_glink_smem.c:93:48: sparse: got void *
>> drivers/rpmsg/qcom_glink_smem.c:96:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *s @@ got void *fifo @@
drivers/rpmsg/qcom_glink_smem.c:96:47: sparse: expected void const volatile [noderef] __iomem *s
drivers/rpmsg/qcom_glink_smem.c:96:47: sparse: got void *fifo
vim +/__user +1483 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
5569a1260933ae Michael Zoran 2017-03-07 1459
5569a1260933ae Michael Zoran 2017-03-07 1460 #define VCHIQ_IOC_CREATE_SERVICE32 \
5569a1260933ae Michael Zoran 2017-03-07 1461 _IOWR(VCHIQ_IOC_MAGIC, 2, struct vchiq_create_service32)
5569a1260933ae Michael Zoran 2017-03-07 1462
5569a1260933ae Michael Zoran 2017-03-07 1463 static long
5569a1260933ae Michael Zoran 2017-03-07 1464 vchiq_compat_ioctl_create_service(
5569a1260933ae Michael Zoran 2017-03-07 1465 struct file *file,
5569a1260933ae Michael Zoran 2017-03-07 1466 unsigned int cmd,
5569a1260933ae Michael Zoran 2017-03-07 1467 unsigned long arg)
5569a1260933ae Michael Zoran 2017-03-07 1468 {
562943286c7466 Dominic Braun 2018-12-14 1469 struct vchiq_create_service __user *args;
5569a1260933ae Michael Zoran 2017-03-07 1470 struct vchiq_create_service32 __user *ptrargs32 =
5569a1260933ae Michael Zoran 2017-03-07 1471 (struct vchiq_create_service32 __user *)arg;
5569a1260933ae Michael Zoran 2017-03-07 1472 struct vchiq_create_service32 args32;
5569a1260933ae Michael Zoran 2017-03-07 1473 long ret;
5569a1260933ae Michael Zoran 2017-03-07 1474
5569a1260933ae Michael Zoran 2017-03-07 1475 args = compat_alloc_user_space(sizeof(*args));
5569a1260933ae Michael Zoran 2017-03-07 1476 if (!args)
5569a1260933ae Michael Zoran 2017-03-07 1477 return -EFAULT;
5569a1260933ae Michael Zoran 2017-03-07 1478
ffb99752e93053 Jasminko Dedic 2019-03-25 1479 if (copy_from_user(&args32, ptrargs32, sizeof(args32)))
5569a1260933ae Michael Zoran 2017-03-07 1480 return -EFAULT;
5569a1260933ae Michael Zoran 2017-03-07 1481
5569a1260933ae Michael Zoran 2017-03-07 1482 if (put_user(args32.params.fourcc, &args->params.fourcc) ||
5569a1260933ae Michael Zoran 2017-03-07 @1483 put_user(compat_ptr(args32.params.callback),
5569a1260933ae Michael Zoran 2017-03-07 1484 &args->params.callback) ||
5569a1260933ae Michael Zoran 2017-03-07 1485 put_user(compat_ptr(args32.params.userdata),
5569a1260933ae Michael Zoran 2017-03-07 1486 &args->params.userdata) ||
5569a1260933ae Michael Zoran 2017-03-07 1487 put_user(args32.params.version, &args->params.version) ||
5569a1260933ae Michael Zoran 2017-03-07 1488 put_user(args32.params.version_min,
5569a1260933ae Michael Zoran 2017-03-07 1489 &args->params.version_min) ||
5569a1260933ae Michael Zoran 2017-03-07 1490 put_user(args32.is_open, &args->is_open) ||
5569a1260933ae Michael Zoran 2017-03-07 1491 put_user(args32.is_vchi, &args->is_vchi) ||
5569a1260933ae Michael Zoran 2017-03-07 1492 put_user(args32.handle, &args->handle))
5569a1260933ae Michael Zoran 2017-03-07 1493 return -EFAULT;
5569a1260933ae Michael Zoran 2017-03-07 1494
5569a1260933ae Michael Zoran 2017-03-07 1495 ret = vchiq_ioctl(file, VCHIQ_IOC_CREATE_SERVICE, (unsigned long)args);
5569a1260933ae Michael Zoran 2017-03-07 1496
5569a1260933ae Michael Zoran 2017-03-07 1497 if (ret < 0)
5569a1260933ae Michael Zoran 2017-03-07 1498 return ret;
5569a1260933ae Michael Zoran 2017-03-07 1499
5569a1260933ae Michael Zoran 2017-03-07 1500 if (get_user(args32.handle, &args->handle))
5569a1260933ae Michael Zoran 2017-03-07 1501 return -EFAULT;
5569a1260933ae Michael Zoran 2017-03-07 1502
5569a1260933ae Michael Zoran 2017-03-07 1503 if (copy_to_user(&ptrargs32->handle,
5569a1260933ae Michael Zoran 2017-03-07 1504 &args32.handle,
5569a1260933ae Michael Zoran 2017-03-07 1505 sizeof(args32.handle)))
5569a1260933ae Michael Zoran 2017-03-07 1506 return -EFAULT;
5569a1260933ae Michael Zoran 2017-03-07 1507
5569a1260933ae Michael Zoran 2017-03-07 1508 return 0;
5569a1260933ae Michael Zoran 2017-03-07 1509 }
5569a1260933ae Michael Zoran 2017-03-07 1510
:::::: The code at line 1483 was first introduced by commit
:::::: 5569a1260933ae105acdd50d70decfa868f7c3b5 staging: vchiq_arm: Add compatibility wrappers for ioctls
:::::: TO: Michael Zoran <mzoran@...wfest.net>
:::::: CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
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" (37155 bytes)
Powered by blists - more mailing lists