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  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:   Sun, 17 Jan 2021 18:51:42 +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,
        Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Subject: fs/fat/file.c:44:15: sparse: sparse: incorrect type in argument 1
 (different address spaces)

Hi Luc,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0da0a8a0a0e1845f495431c3d8d733d2bbf9e9e5
commit: e5fc436f06eef54ef512ea55a9db8eb9f2e76959 sparse: use static inline for __chk_{user,io}_ptr()
date:   5 months ago
config: sh-randconfig-s031-20210117 (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.3-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5fc436f06eef54ef512ea55a9db8eb9f2e76959
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e5fc436f06eef54ef512ea55a9db8eb9f2e76959
        # 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/fat/file.c:44:15: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user *user_attr @@
   fs/fat/file.c:44:15: sparse:     expected unsigned int const *__gu_addr
   fs/fat/file.c:44:15: sparse:     got unsigned int [noderef] [usertype] __user *user_attr
>> fs/fat/file.c:44:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   fs/fat/file.c:44:15: sparse:     expected void const volatile [noderef] __user *ptr
   fs/fat/file.c:44:15: sparse:     got unsigned int const *__gu_addr
--
   fs/jfs/ioctl.c:83:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/jfs/ioctl.c:83:21: sparse:     expected int const *__gu_addr
   fs/jfs/ioctl.c:83:21: sparse:     got int [noderef] __user *
>> fs/jfs/ioctl.c:83:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/jfs/ioctl.c:83:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/jfs/ioctl.c:83:21: sparse:     got int const *__gu_addr
--
   fs/xfs/xfs_ioctl.c:2257:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   fs/xfs/xfs_ioctl.c:2257:21: sparse:     expected unsigned int const *__gu_addr
   fs/xfs/xfs_ioctl.c:2257:21: sparse:     got unsigned int [noderef] [usertype] __user *
>> fs/xfs/xfs_ioctl.c:2257:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   fs/xfs/xfs_ioctl.c:2257:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/xfs/xfs_ioctl.c:2257:21: sparse:     got unsigned int const *__gu_addr
--
   fs/nilfs2/ioctl.c:138:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/nilfs2/ioctl.c:138:13: sparse:     expected int const *__gu_addr
   fs/nilfs2/ioctl.c:138:13: sparse:     got int [noderef] __user *
>> fs/nilfs2/ioctl.c:138:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/nilfs2/ioctl.c:138:13: sparse:     expected void const volatile [noderef] __user *ptr
   fs/nilfs2/ioctl.c:138:13: sparse:     got int const *__gu_addr
--
>> arch/sh/kernel/process_32.c:42:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/kernel/process_32.c:42:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/kernel/process_32.c:42:9: sparse:     got unsigned int
--
   arch/sh/mm/init.c: note: in included file (through arch/sh/include/asm/mmu_context.h):
>> arch/sh/include/asm/mmu_context_32.h:53:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/include/asm/mmu_context_32.h:53:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/include/asm/mmu_context_32.h:53:9: sparse:     got unsigned int
--
>> arch/sh/mm/tlbflush_32.c:134:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/mm/tlbflush_32.c:134:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlbflush_32.c:134:9: sparse:     got unsigned int
>> arch/sh/mm/tlbflush_32.c:134:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/mm/tlbflush_32.c:134:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlbflush_32.c:134:9: sparse:     got unsigned int
--
>> arch/sh/mm/tlb-sh3.c:41:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/mm/tlb-sh3.c:41:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlb-sh3.c:41:9: sparse:     got unsigned int
   arch/sh/mm/tlb-sh3.c:48:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/mm/tlb-sh3.c:48:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlb-sh3.c:48:9: sparse:     got unsigned int
>> arch/sh/mm/tlb-sh3.c:75:17: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned long @@
   arch/sh/mm/tlb-sh3.c:75:17: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlb-sh3.c:75:17: sparse:     got unsigned long
   arch/sh/mm/tlb-sh3.c:90:18: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/mm/tlb-sh3.c:90:18: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlb-sh3.c:90:18: sparse:     got unsigned int
   arch/sh/mm/tlb-sh3.c:92:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/mm/tlb-sh3.c:92:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/mm/tlb-sh3.c:92:9: sparse:     got unsigned int
--
>> arch/sh/kernel/cpu/sh3/clock-sh7712.c:23:21: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:23:21: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:23:21: sparse:     got unsigned int
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:35:21: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:35:21: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:35:21: sparse:     got unsigned int
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:47:21: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:47:21: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/kernel/cpu/sh3/clock-sh7712.c:47:21: sparse:     got unsigned int
--
   fs/exec.c:418:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected char const [noderef] __user *const *__gu_addr @@     got char const [noderef] __user *const [noderef] __user * @@
   fs/exec.c:418:13: sparse:     expected char const [noderef] __user *const *__gu_addr
   fs/exec.c:418:13: sparse:     got char const [noderef] __user *const [noderef] __user *
   fs/exec.c:418:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got char const [noderef] __user *const *__gu_addr @@
   fs/exec.c:418:13: sparse:     expected void const volatile [noderef] __user *ptr
   fs/exec.c:418:13: sparse:     got char const [noderef] __user *const *__gu_addr
   fs/exec.c:419:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected char const [noderef] __user * @@     got void * @@
   fs/exec.c:419:31: sparse:     expected char const [noderef] __user *
   fs/exec.c:419:31: sparse:     got void *
   fs/exec.c:1156:48: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sighand_struct *oldsighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   fs/exec.c:1156:48: sparse:     expected struct sighand_struct *oldsighand
   fs/exec.c:1156:48: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   fs/exec.c:1263:56: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *parent @@
   fs/exec.c:1263:56: sparse:     expected struct task_struct *parent
   fs/exec.c:1263:56: sparse:     got struct task_struct [noderef] __rcu *parent
   fs/exec.c:1298:47: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sighand_struct *oldsighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   fs/exec.c:1298:47: sparse:     expected struct sighand_struct *oldsighand
   fs/exec.c:1298:47: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   fs/exec.c:1851:70: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct task_struct *tsk @@     got struct task_struct [noderef] __rcu *parent @@
   fs/exec.c:1851:70: sparse:     expected struct task_struct *tsk
   fs/exec.c:1851:70: sparse:     got struct task_struct [noderef] __rcu *parent
   fs/exec.c: note: in included file (through arch/sh/include/asm/mmu_context.h):
>> arch/sh/include/asm/mmu_context_32.h:53:9: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected void const volatile [noderef] __iomem *ptr @@     got unsigned int @@
   arch/sh/include/asm/mmu_context_32.h:53:9: sparse:     expected void const volatile [noderef] __iomem *ptr
   arch/sh/include/asm/mmu_context_32.h:53:9: sparse:     got unsigned int
--
   block/ioctl.c:66:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   block/ioctl.c:66:13: sparse:     expected int const *__gu_addr
   block/ioctl.c:66:13: sparse:     got int [noderef] __user *
>> block/ioctl.c:66:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   block/ioctl.c:66:13: sparse:     expected void const volatile [noderef] __user *ptr
   block/ioctl.c:66:13: sparse:     got int const *__gu_addr
   block/ioctl.c:66:39: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __user *const *__gu_addr @@     got void [noderef] __user *[noderef] __user * @@
   block/ioctl.c:66:39: sparse:     expected void [noderef] __user *const *__gu_addr
   block/ioctl.c:66:39: sparse:     got void [noderef] __user *[noderef] __user *
>> block/ioctl.c:66:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got void [noderef] __user *const *__gu_addr @@
   block/ioctl.c:66:39: sparse:     expected void const volatile [noderef] __user *ptr
   block/ioctl.c:66:39: sparse:     got void [noderef] __user *const *__gu_addr
   block/ioctl.c:393:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   block/ioctl.c:393:13: sparse:     expected int const *__gu_addr
   block/ioctl.c:393:13: sparse:     got int [noderef] __user *
   block/ioctl.c:393:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   block/ioctl.c:393:13: sparse:     expected void const volatile [noderef] __user *ptr
   block/ioctl.c:393:13: sparse:     got int const *__gu_addr
   block/ioctl.c:474:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *argp @@
   block/ioctl.c:474:13: sparse:     expected int const *__gu_addr
   block/ioctl.c:474:13: sparse:     got int [noderef] __user *argp
   block/ioctl.c:474:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   block/ioctl.c:474:13: sparse:     expected void const volatile [noderef] __user *ptr
   block/ioctl.c:474:13: sparse:     got int const *__gu_addr
--
   block/scsi_ioctl.c:65:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *p @@
   block/scsi_ioctl.c:65:28: sparse:     expected int const *__gu_addr
   block/scsi_ioctl.c:65:28: sparse:     got int [noderef] __user *p
>> block/scsi_ioctl.c:65:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   block/scsi_ioctl.c:65:28: sparse:     expected void const volatile [noderef] __user *ptr
   block/scsi_ioctl.c:65:28: sparse:     got int const *__gu_addr
   block/scsi_ioctl.c:91:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *p @@
   block/scsi_ioctl.c:91:25: sparse:     expected int const *__gu_addr
   block/scsi_ioctl.c:91:25: sparse:     got int [noderef] __user *p
   block/scsi_ioctl.c:91:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   block/scsi_ioctl.c:91:25: sparse:     expected void const volatile [noderef] __user *ptr
   block/scsi_ioctl.c:91:25: sparse:     got int const *__gu_addr
   block/scsi_ioctl.c:433:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] __user * @@
   block/scsi_ioctl.c:433:13: sparse:     expected unsigned int const *__gu_addr
   block/scsi_ioctl.c:433:13: sparse:     got unsigned int [noderef] __user *
>> block/scsi_ioctl.c:433:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   block/scsi_ioctl.c:433:13: sparse:     expected void const volatile [noderef] __user *ptr
   block/scsi_ioctl.c:433:13: sparse:     got unsigned int const *__gu_addr
   block/scsi_ioctl.c:435:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] __user * @@
   block/scsi_ioctl.c:435:13: sparse:     expected unsigned int const *__gu_addr
   block/scsi_ioctl.c:435:13: sparse:     got unsigned int [noderef] __user *
   block/scsi_ioctl.c:435:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   block/scsi_ioctl.c:435:13: sparse:     expected void const volatile [noderef] __user *ptr
   block/scsi_ioctl.c:435:13: sparse:     got unsigned int const *__gu_addr
   block/scsi_ioctl.c:439:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned char const *__gu_addr @@     got unsigned char [noderef] __user * @@
   block/scsi_ioctl.c:439:13: sparse:     expected unsigned char const *__gu_addr
   block/scsi_ioctl.c:439:13: sparse:     got unsigned char [noderef] __user *
>> block/scsi_ioctl.c:439:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned char const *__gu_addr @@
   block/scsi_ioctl.c:439:13: sparse:     expected void const volatile [noderef] __user *ptr
   block/scsi_ioctl.c:439:13: sparse:     got unsigned char const *__gu_addr
--
   drivers/gpu/drm/drm_crtc.c:708:29: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   drivers/gpu/drm/drm_crtc.c:708:29: sparse:     expected unsigned int const *__gu_addr
   drivers/gpu/drm/drm_crtc.c:708:29: sparse:     got unsigned int [noderef] [usertype] __user *
>> drivers/gpu/drm/drm_crtc.c:708:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   drivers/gpu/drm/drm_crtc.c:708:29: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/drm_crtc.c:708:29: sparse:     got unsigned int const *__gu_addr
--
   drivers/scsi/scsi_error.c:2341:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user *arg @@
   drivers/scsi/scsi_error.c:2341:17: sparse:     expected int const *__gu_addr
   drivers/scsi/scsi_error.c:2341:17: sparse:     got int [noderef] __user *arg
>> drivers/scsi/scsi_error.c:2341:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   drivers/scsi/scsi_error.c:2341:17: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/scsi/scsi_error.c:2341:17: sparse:     got int const *__gu_addr
--
   drivers/scsi/scsi_ioctl.c:48:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] __user * @@
   drivers/scsi/scsi_ioctl.c:48:21: sparse:     expected unsigned int const *__gu_addr
   drivers/scsi/scsi_ioctl.c:48:21: sparse:     got unsigned int [noderef] __user *
>> drivers/scsi/scsi_ioctl.c:48:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   drivers/scsi/scsi_ioctl.c:48:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/scsi/scsi_ioctl.c:48:21: sparse:     got unsigned int const *__gu_addr
--
   drivers/video/fbdev/s3c-fb.c:1024:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   drivers/video/fbdev/s3c-fb.c:1024:21: sparse:     expected unsigned int const *__gu_addr
   drivers/video/fbdev/s3c-fb.c:1024:21: sparse:     got unsigned int [noderef] [usertype] __user *
>> drivers/video/fbdev/s3c-fb.c:1024:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   drivers/video/fbdev/s3c-fb.c:1024:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/video/fbdev/s3c-fb.c:1024:21: sparse:     got unsigned int const *__gu_addr
--
   samples/vfio-mdev/mbochs.c:1270:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   samples/vfio-mdev/mbochs.c:1270:21: sparse:     expected unsigned int const *__gu_addr
   samples/vfio-mdev/mbochs.c:1270:21: sparse:     got unsigned int [noderef] [usertype] __user *
>> samples/vfio-mdev/mbochs.c:1270:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   samples/vfio-mdev/mbochs.c:1270:21: sparse:     expected void const volatile [noderef] __user *ptr
   samples/vfio-mdev/mbochs.c:1270:21: sparse:     got unsigned int const *__gu_addr
   samples/vfio-mdev/mbochs.c:1346:1: sparse: sparse: symbol 'mdev_type_attr_name' was not declared. Should it be static?
   samples/vfio-mdev/mbochs.c:1356:1: sparse: sparse: symbol 'mdev_type_attr_description' was not declared. Should it be static?
   samples/vfio-mdev/mbochs.c:1366:1: sparse: sparse: symbol 'mdev_type_attr_available_instances' was not declared. Should it be static?
   samples/vfio-mdev/mbochs.c:1373:1: sparse: sparse: symbol 'mdev_type_attr_device_api' was not declared. Should it be static?
--
   fs/reiserfs/ioctl.c:66:29: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/reiserfs/ioctl.c:66:29: sparse:     expected int const *__gu_addr
   fs/reiserfs/ioctl.c:66:29: sparse:     got int [noderef] __user *
>> fs/reiserfs/ioctl.c:66:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/reiserfs/ioctl.c:66:29: sparse:     expected void const volatile [noderef] __user *ptr
   fs/reiserfs/ioctl.c:66:29: sparse:     got int const *__gu_addr
   fs/reiserfs/ioctl.c:111:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/reiserfs/ioctl.c:111:21: sparse:     expected int const *__gu_addr
   fs/reiserfs/ioctl.c:111:21: sparse:     got int [noderef] __user *
   fs/reiserfs/ioctl.c:111:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/reiserfs/ioctl.c:111:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/reiserfs/ioctl.c:111:21: sparse:     got int const *__gu_addr
--
   fs/ext4/ioctl.c:609:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   fs/ext4/ioctl.c:609:13: sparse:     expected unsigned int const *__gu_addr
   fs/ext4/ioctl.c:609:13: sparse:     got unsigned int [noderef] [usertype] __user *
>> fs/ext4/ioctl.c:609:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   fs/ext4/ioctl.c:609:13: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext4/ioctl.c:609:13: sparse:     got unsigned int const *__gu_addr
   fs/ext4/ioctl.c:833:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/ext4/ioctl.c:833:21: sparse:     expected int const *__gu_addr
   fs/ext4/ioctl.c:833:21: sparse:     got int [noderef] __user *
>> fs/ext4/ioctl.c:833:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/ext4/ioctl.c:833:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext4/ioctl.c:833:21: sparse:     got int const *__gu_addr
   fs/ext4/ioctl.c:884:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/ext4/ioctl.c:884:21: sparse:     expected int const *__gu_addr
   fs/ext4/ioctl.c:884:21: sparse:     got int [noderef] __user *
   fs/ext4/ioctl.c:884:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/ext4/ioctl.c:884:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext4/ioctl.c:884:21: sparse:     got int const *__gu_addr
   fs/ext4/ioctl.c:917:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   fs/ext4/ioctl.c:917:21: sparse:     expected unsigned int const *__gu_addr
   fs/ext4/ioctl.c:917:21: sparse:     got unsigned int [noderef] [usertype] __user *
   fs/ext4/ioctl.c:917:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   fs/ext4/ioctl.c:917:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext4/ioctl.c:917:21: sparse:     got unsigned int const *__gu_addr
--
   fs/ext2/ioctl.c:47:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/ext2/ioctl.c:47:21: sparse:     expected int const *__gu_addr
   fs/ext2/ioctl.c:47:21: sparse:     got int [noderef] __user *
>> fs/ext2/ioctl.c:47:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/ext2/ioctl.c:47:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext2/ioctl.c:47:21: sparse:     got int const *__gu_addr
   fs/ext2/ioctl.c:92:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/ext2/ioctl.c:92:21: sparse:     expected int const *__gu_addr
   fs/ext2/ioctl.c:92:21: sparse:     got int [noderef] __user *
   fs/ext2/ioctl.c:92:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/ext2/ioctl.c:92:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext2/ioctl.c:92:21: sparse:     got int const *__gu_addr
   fs/ext2/ioctl.c:123:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const *__gu_addr @@     got int [noderef] __user * @@
   fs/ext2/ioctl.c:123:21: sparse:     expected int const *__gu_addr
   fs/ext2/ioctl.c:123:21: sparse:     got int [noderef] __user *
   fs/ext2/ioctl.c:123:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int const *__gu_addr @@
   fs/ext2/ioctl.c:123:21: sparse:     expected void const volatile [noderef] __user *ptr
   fs/ext2/ioctl.c:123:21: sparse:     got int const *__gu_addr

vim +44 fs/fat/file.c

21bea495943f9532 Christoph Hellwig 2009-06-08   34  
21bea495943f9532 Christoph Hellwig 2009-06-08   35  static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
^1da177e4c3f4152 Linus Torvalds    2005-04-16   36  {
496ad9aa8ef44805 Al Viro           2013-01-23   37  	struct inode *inode = file_inode(file);
21bea495943f9532 Christoph Hellwig 2009-06-08   38  	struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
21bea495943f9532 Christoph Hellwig 2009-06-08   39  	int is_dir = S_ISDIR(inode->i_mode);
^1da177e4c3f4152 Linus Torvalds    2005-04-16   40  	u32 attr, oldattr;
^1da177e4c3f4152 Linus Torvalds    2005-04-16   41  	struct iattr ia;
21bea495943f9532 Christoph Hellwig 2009-06-08   42  	int err;
^1da177e4c3f4152 Linus Torvalds    2005-04-16   43  
^1da177e4c3f4152 Linus Torvalds    2005-04-16  @44  	err = get_user(attr, user_attr);
^1da177e4c3f4152 Linus Torvalds    2005-04-16   45  	if (err)
21bea495943f9532 Christoph Hellwig 2009-06-08   46  		goto out;
^1da177e4c3f4152 Linus Torvalds    2005-04-16   47  
a561be7100cd610b Al Viro           2011-11-23   48  	err = mnt_want_write_file(file);
42a74f206b914db1 Dave Hansen       2008-02-15   49  	if (err)
e24f17da3560781e Jan Kara          2012-06-12   50  		goto out;
5955102c9984fa08 Al Viro           2016-01-22   51  	inode_lock(inode);
^1da177e4c3f4152 Linus Torvalds    2005-04-16   52  
^1da177e4c3f4152 Linus Torvalds    2005-04-16   53  	/*
^1da177e4c3f4152 Linus Torvalds    2005-04-16   54  	 * ATTR_VOLUME and ATTR_DIR cannot be changed; this also
^1da177e4c3f4152 Linus Torvalds    2005-04-16   55  	 * prevents the user from turning us into a VFAT
^1da177e4c3f4152 Linus Torvalds    2005-04-16   56  	 * longname entry.  Also, we obviously can't set
^1da177e4c3f4152 Linus Torvalds    2005-04-16   57  	 * any of the NTFS attributes in the high 24 bits.
^1da177e4c3f4152 Linus Torvalds    2005-04-16   58  	 */
^1da177e4c3f4152 Linus Torvalds    2005-04-16   59  	attr &= 0xff & ~(ATTR_VOLUME | ATTR_DIR);
^1da177e4c3f4152 Linus Torvalds    2005-04-16   60  	/* Merge in ATTR_VOLUME and ATTR_DIR */
^1da177e4c3f4152 Linus Torvalds    2005-04-16   61  	attr |= (MSDOS_I(inode)->i_attrs & ATTR_VOLUME) |
^1da177e4c3f4152 Linus Torvalds    2005-04-16   62  		(is_dir ? ATTR_DIR : 0);
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06   63  	oldattr = fat_make_attrs(inode);
^1da177e4c3f4152 Linus Torvalds    2005-04-16   64  
^1da177e4c3f4152 Linus Torvalds    2005-04-16   65  	/* Equivalent to a chmod() */
^1da177e4c3f4152 Linus Torvalds    2005-04-16   66  	ia.ia_valid = ATTR_MODE | ATTR_CTIME;
c2050a454c7f123d Deepa Dinamani    2016-09-14   67  	ia.ia_ctime = current_time(inode);
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06   68  	if (is_dir)
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06   69  		ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO);
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06   70  	else {
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06   71  		ia.ia_mode = fat_make_mode(sbi, attr,
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06   72  			S_IRUGO | S_IWUGO | (inode->i_mode & S_IXUGO));
^1da177e4c3f4152 Linus Torvalds    2005-04-16   73  	}
^1da177e4c3f4152 Linus Torvalds    2005-04-16   74  
^1da177e4c3f4152 Linus Torvalds    2005-04-16   75  	/* The root directory has no attributes */
^1da177e4c3f4152 Linus Torvalds    2005-04-16   76  	if (inode->i_ino == MSDOS_ROOT_INO && attr != ATTR_DIR) {
^1da177e4c3f4152 Linus Torvalds    2005-04-16   77  		err = -EINVAL;
e24f17da3560781e Jan Kara          2012-06-12   78  		goto out_unlock_inode;
^1da177e4c3f4152 Linus Torvalds    2005-04-16   79  	}
^1da177e4c3f4152 Linus Torvalds    2005-04-16   80  
21bea495943f9532 Christoph Hellwig 2009-06-08   81  	if (sbi->options.sys_immutable &&
21bea495943f9532 Christoph Hellwig 2009-06-08   82  	    ((attr | oldattr) & ATTR_SYS) &&
21bea495943f9532 Christoph Hellwig 2009-06-08   83  	    !capable(CAP_LINUX_IMMUTABLE)) {
^1da177e4c3f4152 Linus Torvalds    2005-04-16   84  		err = -EPERM;
e24f17da3560781e Jan Kara          2012-06-12   85  		goto out_unlock_inode;
^1da177e4c3f4152 Linus Torvalds    2005-04-16   86  	}
^1da177e4c3f4152 Linus Torvalds    2005-04-16   87  
b1da47e29e467f1e Miklos Szeredi    2008-07-01   88  	/*
b1da47e29e467f1e Miklos Szeredi    2008-07-01   89  	 * The security check is questionable...  We single
b1da47e29e467f1e Miklos Szeredi    2008-07-01   90  	 * out the RO attribute for checking by the security
b1da47e29e467f1e Miklos Szeredi    2008-07-01   91  	 * module, just because it maps to a file mode.
b1da47e29e467f1e Miklos Szeredi    2008-07-01   92  	 */
21bea495943f9532 Christoph Hellwig 2009-06-08   93  	err = security_inode_setattr(file->f_path.dentry, &ia);
b1da47e29e467f1e Miklos Szeredi    2008-07-01   94  	if (err)
e24f17da3560781e Jan Kara          2012-06-12   95  		goto out_unlock_inode;
b1da47e29e467f1e Miklos Szeredi    2008-07-01   96  
^1da177e4c3f4152 Linus Torvalds    2005-04-16   97  	/* This MUST be done before doing anything irreversible... */
21bea495943f9532 Christoph Hellwig 2009-06-08   98  	err = fat_setattr(file->f_path.dentry, &ia);
^1da177e4c3f4152 Linus Torvalds    2005-04-16   99  	if (err)
e24f17da3560781e Jan Kara          2012-06-12  100  		goto out_unlock_inode;
^1da177e4c3f4152 Linus Torvalds    2005-04-16  101  
21bea495943f9532 Christoph Hellwig 2009-06-08  102  	fsnotify_change(file->f_path.dentry, ia.ia_valid);
^1da177e4c3f4152 Linus Torvalds    2005-04-16  103  	if (sbi->options.sys_immutable) {
^1da177e4c3f4152 Linus Torvalds    2005-04-16  104  		if (attr & ATTR_SYS)
^1da177e4c3f4152 Linus Torvalds    2005-04-16  105  			inode->i_flags |= S_IMMUTABLE;
^1da177e4c3f4152 Linus Torvalds    2005-04-16  106  		else
1adffbae22332bb5 OGAWA Hirofumi    2011-05-31  107  			inode->i_flags &= ~S_IMMUTABLE;
^1da177e4c3f4152 Linus Torvalds    2005-04-16  108  	}
^1da177e4c3f4152 Linus Torvalds    2005-04-16  109  
9c0aa1b87bf541af OGAWA Hirofumi    2008-11-06  110  	fat_save_attrs(inode, attr);
^1da177e4c3f4152 Linus Torvalds    2005-04-16  111  	mark_inode_dirty(inode);
21bea495943f9532 Christoph Hellwig 2009-06-08  112  out_unlock_inode:
5955102c9984fa08 Al Viro           2016-01-22  113  	inode_unlock(inode);
e24f17da3560781e Jan Kara          2012-06-12  114  	mnt_drop_write_file(file);
21bea495943f9532 Christoph Hellwig 2009-06-08  115  out:
^1da177e4c3f4152 Linus Torvalds    2005-04-16  116  	return err;
^1da177e4c3f4152 Linus Torvalds    2005-04-16  117  }
21bea495943f9532 Christoph Hellwig 2009-06-08  118  

:::::: The code at line 44 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.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" (23222 bytes)

Powered by blists - more mailing lists