mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1483:13: sparse: sparse: cast removes address space '__user' of expression
Date: Tue, 14 Jul 2020 04:16:57 +0800	[thread overview]
Message-ID: <202007140452.jSEnaqaB%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 8664 bytes --]

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@intel.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@crowfest.net>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37155 bytes --]

                 reply	other threads:[~2020-07-13 20:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202007140452.jSEnaqaB%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®