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: <202007091855.CJBpUVBf%lkp@intel.com>
Date:   Thu, 9 Jul 2020 18:33:01 +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: fs/orangefs/file.c:424:21: sparse: sparse: incorrect type in
 argument 1 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0bddd227f3dc55975e2b8dfa7fc6f959b062a2c7
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   3 weeks ago
config: sh-randconfig-s032-20200709 (attached as .config)
compiler: sh4-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=sh 

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

   fs/orangefs/file.c:118:32: sparse: sparse: incorrect type in assignment (different base types) @@     expected int open_for_write @@     got restricted fmode_t @@
   fs/orangefs/file.c:118:32: sparse:     expected int open_for_write
   fs/orangefs/file.c:118:32: sparse:     got restricted fmode_t
   fs/orangefs/file.c:119:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected int open_for_read @@     got restricted fmode_t @@
   fs/orangefs/file.c:119:31: sparse:     expected int open_for_read
   fs/orangefs/file.c:119:31: sparse:     got restricted fmode_t
   fs/orangefs/file.c:424:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/orangefs/file.c:424:21: sparse:     expected int const *__gu_addr
   fs/orangefs/file.c:424:21: sparse:     got int [noderef] __user *
>> fs/orangefs/file.c:424:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int const *__gu_addr @@
>> fs/orangefs/file.c:424:21: sparse:     expected void const volatile [noderef] __user *
   fs/orangefs/file.c:424:21: sparse:     got int const *__gu_addr
--
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   net/bluetooth/rfcomm/sock.c:659:21: sparse:     expected unsigned int const *__gu_addr
>> net/bluetooth/rfcomm/sock.c:659:21: sparse:     got unsigned int [noderef] [usertype] __user *
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got unsigned int const *__gu_addr @@
>> net/bluetooth/rfcomm/sock.c:659:21: sparse:     expected void const volatile [noderef] __user *
   net/bluetooth/rfcomm/sock.c:659:21: sparse:     got unsigned int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:735:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   net/bluetooth/rfcomm/sock.c:735:21: sparse:     expected unsigned int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:735:21: sparse:     got unsigned int [noderef] [usertype] __user *
   net/bluetooth/rfcomm/sock.c:735:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got unsigned int const *__gu_addr @@
   net/bluetooth/rfcomm/sock.c:735:21: sparse:     expected void const volatile [noderef] __user *
   net/bluetooth/rfcomm/sock.c:735:21: sparse:     got unsigned int const *__gu_addr
>> net/bluetooth/rfcomm/sock.c:767:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *optlen @@
   net/bluetooth/rfcomm/sock.c:767:13: sparse:     expected int const *__gu_addr
>> net/bluetooth/rfcomm/sock.c:767:13: sparse:     got int [noderef] __user *optlen
>> net/bluetooth/rfcomm/sock.c:767:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int const *__gu_addr @@
   net/bluetooth/rfcomm/sock.c:767:13: sparse:     expected void const volatile [noderef] __user *
   net/bluetooth/rfcomm/sock.c:767:13: sparse:     got int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:845:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *optlen @@
   net/bluetooth/rfcomm/sock.c:845:13: sparse:     expected int const *__gu_addr
   net/bluetooth/rfcomm/sock.c:845:13: sparse:     got int [noderef] __user *optlen
   net/bluetooth/rfcomm/sock.c:845:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int const *__gu_addr @@
   net/bluetooth/rfcomm/sock.c:845:13: sparse:     expected void const volatile [noderef] __user *
   net/bluetooth/rfcomm/sock.c:845:13: sparse:     got int const *__gu_addr
--
   drivers/rtc/rtc-m41t80.c:736:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   drivers/rtc/rtc-m41t80.c:736:21: sparse:     expected int const *__gu_addr
   drivers/rtc/rtc-m41t80.c:736:21: sparse:     got int [noderef] __user *
>> drivers/rtc/rtc-m41t80.c:736:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got int const *__gu_addr @@
>> drivers/rtc/rtc-m41t80.c:736:21: sparse:     expected void const volatile [noderef] __user *
   drivers/rtc/rtc-m41t80.c:736:21: sparse:     got int const *__gu_addr

vim +424 fs/orangefs/file.c

5aca284210ce82 Darrick J. Wong 2019-07-01  393  
5db11c21a929cd Mike Marshall   2015-07-17  394  /*
5db11c21a929cd Mike Marshall   2015-07-17  395   * Perform a miscellaneous operation on a file.
5db11c21a929cd Mike Marshall   2015-07-17  396   */
8bb8aefd5afb54 Yi Liu          2015-11-24  397  static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
5db11c21a929cd Mike Marshall   2015-07-17  398  {
5aca284210ce82 Darrick J. Wong 2019-07-01  399  	struct inode *inode = file_inode(file);
5db11c21a929cd Mike Marshall   2015-07-17  400  	int ret = -ENOTTY;
5db11c21a929cd Mike Marshall   2015-07-17  401  	__u64 val = 0;
5db11c21a929cd Mike Marshall   2015-07-17  402  	unsigned long uval;
5db11c21a929cd Mike Marshall   2015-07-17  403  
5db11c21a929cd Mike Marshall   2015-07-17  404  	gossip_debug(GOSSIP_FILE_DEBUG,
8bb8aefd5afb54 Yi Liu          2015-11-24  405  		     "orangefs_ioctl: called with cmd %d\n",
5db11c21a929cd Mike Marshall   2015-07-17  406  		     cmd);
5db11c21a929cd Mike Marshall   2015-07-17  407  
5db11c21a929cd Mike Marshall   2015-07-17  408  	/*
5db11c21a929cd Mike Marshall   2015-07-17  409  	 * we understand some general ioctls on files, such as the immutable
5db11c21a929cd Mike Marshall   2015-07-17  410  	 * and append flags
5db11c21a929cd Mike Marshall   2015-07-17  411  	 */
5db11c21a929cd Mike Marshall   2015-07-17  412  	if (cmd == FS_IOC_GETFLAGS) {
5aca284210ce82 Darrick J. Wong 2019-07-01  413  		ret = orangefs_getflags(inode, &uval);
5aca284210ce82 Darrick J. Wong 2019-07-01  414  		if (ret)
5db11c21a929cd Mike Marshall   2015-07-17  415  			return ret;
5db11c21a929cd Mike Marshall   2015-07-17  416  		gossip_debug(GOSSIP_FILE_DEBUG,
8bb8aefd5afb54 Yi Liu          2015-11-24  417  			     "orangefs_ioctl: FS_IOC_GETFLAGS: %llu\n",
5db11c21a929cd Mike Marshall   2015-07-17  418  			     (unsigned long long)uval);
5db11c21a929cd Mike Marshall   2015-07-17  419  		return put_user(uval, (int __user *)arg);
5db11c21a929cd Mike Marshall   2015-07-17  420  	} else if (cmd == FS_IOC_SETFLAGS) {
5aca284210ce82 Darrick J. Wong 2019-07-01  421  		unsigned long old_uval;
5aca284210ce82 Darrick J. Wong 2019-07-01  422  
5db11c21a929cd Mike Marshall   2015-07-17  423  		ret = 0;
5db11c21a929cd Mike Marshall   2015-07-17 @424  		if (get_user(uval, (int __user *)arg))
5db11c21a929cd Mike Marshall   2015-07-17  425  			return -EFAULT;
5db11c21a929cd Mike Marshall   2015-07-17  426  		/*
8bb8aefd5afb54 Yi Liu          2015-11-24  427  		 * ORANGEFS_MIRROR_FL is set internally when the mirroring mode
5db11c21a929cd Mike Marshall   2015-07-17  428  		 * is turned on for a file. The user is not allowed to turn
5db11c21a929cd Mike Marshall   2015-07-17  429  		 * on this bit, but the bit is present if the user first gets
5db11c21a929cd Mike Marshall   2015-07-17  430  		 * the flags and then updates the flags with some new
5db11c21a929cd Mike Marshall   2015-07-17  431  		 * settings. So, we ignore it in the following edit. bligon.
5db11c21a929cd Mike Marshall   2015-07-17  432  		 */
8bb8aefd5afb54 Yi Liu          2015-11-24  433  		if ((uval & ~ORANGEFS_MIRROR_FL) &
5db11c21a929cd Mike Marshall   2015-07-17  434  		    (~(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NOATIME_FL))) {
8bb8aefd5afb54 Yi Liu          2015-11-24  435  			gossip_err("orangefs_ioctl: the FS_IOC_SETFLAGS only supports setting one of FS_IMMUTABLE_FL|FS_APPEND_FL|FS_NOATIME_FL\n");
5db11c21a929cd Mike Marshall   2015-07-17  436  			return -EINVAL;
5db11c21a929cd Mike Marshall   2015-07-17  437  		}
5aca284210ce82 Darrick J. Wong 2019-07-01  438  		ret = orangefs_getflags(inode, &old_uval);
5aca284210ce82 Darrick J. Wong 2019-07-01  439  		if (ret)
5aca284210ce82 Darrick J. Wong 2019-07-01  440  			return ret;
5aca284210ce82 Darrick J. Wong 2019-07-01  441  		ret = vfs_ioc_setflags_prepare(inode, old_uval, uval);
5aca284210ce82 Darrick J. Wong 2019-07-01  442  		if (ret)
5aca284210ce82 Darrick J. Wong 2019-07-01  443  			return ret;
5db11c21a929cd Mike Marshall   2015-07-17  444  		val = uval;
5db11c21a929cd Mike Marshall   2015-07-17  445  		gossip_debug(GOSSIP_FILE_DEBUG,
8bb8aefd5afb54 Yi Liu          2015-11-24  446  			     "orangefs_ioctl: FS_IOC_SETFLAGS: %llu\n",
5db11c21a929cd Mike Marshall   2015-07-17  447  			     (unsigned long long)val);
5aca284210ce82 Darrick J. Wong 2019-07-01  448  		ret = orangefs_inode_setxattr(inode,
5db11c21a929cd Mike Marshall   2015-07-17  449  					      "user.pvfs2.meta_hint",
555fa0fa618b84 Al Viro         2015-11-11  450  					      &val, sizeof(val), 0);
5db11c21a929cd Mike Marshall   2015-07-17  451  	}
5db11c21a929cd Mike Marshall   2015-07-17  452  
5db11c21a929cd Mike Marshall   2015-07-17  453  	return ret;
5db11c21a929cd Mike Marshall   2015-07-17  454  }
5db11c21a929cd Mike Marshall   2015-07-17  455  

:::::: The code at line 424 was first introduced by commit
:::::: 5db11c21a929cd9d8c0484006efb1014fc723c93 Orangefs: kernel client part 2

:::::: TO: Mike Marshall <hubcap@...ibond.com>
:::::: CC: Mike Marshall <hubcap@...ibond.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ