linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces)
@ 2021-11-23 15:12 kernel test robot
  2021-11-23 16:08 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-11-23 15:12 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel, Russell King (Oracle)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   136057256686de39cc3a07c2e39ef6bc43003ff6
commit: 7e2d8c29ecdd86afbcedb9d9a977bab8af527add ARM: 9111/1: oabi-compat: rework fcntl64() emulation
date:   3 months ago
config: arm-randconfig-s032-20211123 (https://download.01.org/0day-ci/archive/20211123/202111232352.1I2ZjeBh-lkp@intel.com/config.gz)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7e2d8c29ecdd86afbcedb9d9a977bab8af527add
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 7e2d8c29ecdd86afbcedb9d9a977bab8af527add
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm 

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 >>)
>> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected struct flock64 [noderef] __user *user @@     got struct flock64 * @@
   arch/arm/kernel/sys_oabi-compat.c:251:51: sparse:     expected struct flock64 [noderef] __user *user
   arch/arm/kernel/sys_oabi-compat.c:251:51: sparse:     got struct flock64 *
   arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@     expected struct flock64 [noderef] __user *user @@     got struct flock64 * @@
   arch/arm/kernel/sys_oabi-compat.c:265:55: sparse:     expected struct flock64 [noderef] __user *user
   arch/arm/kernel/sys_oabi-compat.c:265:55: sparse:     got struct flock64 *
   arch/arm/kernel/sys_oabi-compat.c:292:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __poll_t [usertype] events @@     got unsigned int [addressable] [usertype] events @@
   arch/arm/kernel/sys_oabi-compat.c:292:23: sparse:     expected restricted __poll_t [usertype] events
   arch/arm/kernel/sys_oabi-compat.c:292:23: sparse:     got unsigned int [addressable] [usertype] events
   arch/arm/kernel/sys_oabi-compat.c:312:21: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int __pu_val @@     got restricted __poll_t [usertype] revents @@
   arch/arm/kernel/sys_oabi-compat.c:312:21: sparse:     expected unsigned int __pu_val
   arch/arm/kernel/sys_oabi-compat.c:312:21: sparse:     got restricted __poll_t [usertype] revents

vim +251 arch/arm/kernel/sys_oabi-compat.c

   230	
   231	asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,
   232					 unsigned long arg)
   233	{
   234		void __user *argp = (void __user *)arg;
   235		struct fd f = fdget_raw(fd);
   236		struct flock64 flock;
   237		long err = -EBADF;
   238	
   239		if (!f.file)
   240			goto out;
   241	
   242		switch (cmd) {
   243		case F_GETLK64:
   244		case F_OFD_GETLK:
   245			err = security_file_fcntl(f.file, cmd, arg);
   246			if (err)
   247				break;
   248			err = get_oabi_flock(&flock, argp);
   249			if (err)
   250				break;
 > 251			err = fcntl_getlk64(f.file, cmd, &flock);
   252			if (!err)
   253			       err = put_oabi_flock(&flock, argp);
   254			break;
   255		case F_SETLK64:
   256		case F_SETLKW64:
   257		case F_OFD_SETLK:
   258		case F_OFD_SETLKW:
   259			err = security_file_fcntl(f.file, cmd, arg);
   260			if (err)
   261				break;
   262			err = get_oabi_flock(&flock, argp);
   263			if (err)
   264				break;
   265			err = fcntl_setlk64(fd, f.file, cmd, &flock);
   266			break;
   267		default:
   268			err = sys_fcntl64(fd, cmd, arg);
   269			break;
   270		}
   271		fdput(f);
   272	out:
   273		return err;
   274	}
   275	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces)
  2021-11-23 15:12 arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) kernel test robot
@ 2021-11-23 16:08 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2021-11-23 16:08 UTC (permalink / raw)
  To: kernel test robot
  Cc: Arnd Bergmann, kbuild-all, Linux Kernel Mailing List,
	Russell King (Oracle)

On Tue, Nov 23, 2021 at 4:12 PM kernel test robot <lkp@intel.com> wrote:
>
> 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 >>)
> >> arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected struct flock64 [noderef] __user *user @@     got struct flock64 * @@
>    arch/arm/kernel/sys_oabi-compat.c:251:51: sparse:     expected struct flock64 [noderef] __user *user
>    arch/arm/kernel/sys_oabi-compat.c:251:51: sparse:     got struct flock64 *
>    arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@     expected struct flock64 [noderef] __user *user @@     got struct flock64 * @@
>    arch/arm/kernel/sys_oabi-compat.c:265:55: sparse:     expected struct flock64 [noderef] __user *user
>    arch/arm/kernel/sys_oabi-compat.c:265:55: sparse:     got struct flock64 *
>    arch/arm/kernel/sys_oabi-compat.c:292:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __poll_t [usertype] events @@     got unsigned int [addressable] [usertype] events @@
>    arch/arm/kernel/sys_oabi-compat.c:292:23: sparse:     expected restricted __poll_t [usertype] events
>    arch/arm/kernel/sys_oabi-compat.c:292:23: sparse:     got unsigned int [addressable] [usertype] events
>    arch/arm/kernel/sys_oabi-compat.c:312:21: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int __pu_val @@     got restricted __poll_t [usertype] revents @@
>    arch/arm/kernel/sys_oabi-compat.c:312:21: sparse:     expected unsigned int __pu_val
>    arch/arm/kernel/sys_oabi-compat.c:312:21: sparse:     got restricted __poll_t [usertype] revents

Thanks for the report. I see this was a pre-existing problem that now
shows up on
arm as well, sent a fix for it at

https://lore.kernel.org/linux-fsdevel/20211123160531.93545-1-arnd@kernel.org/T/

        Arnd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-23 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 15:12 arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) kernel test robot
2021-11-23 16:08 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).