[vfs:work.__copy_in_user 12/28] drivers/gpu/drm/drm_ioc32.c:216:24: sparse: incompatible types in comparison expression (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.__copy_in_user
head:   e9c21090674112b28410bac449820e94178b4716
commit: 4b4f61d275c8ae856303c22dddfb5afbc726e1d1 [12/28] switch compat_drm_addmap() to drm_ioctl_kernel()
reproduce:
        # apt-get install sparse
        git checkout 4b4f61d275c8ae856303c22dddfb5afbc726e1d1
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:264:8: sparse: attribute 'no_sanitize_address': unknown attribute
>> drivers/gpu/drm/drm_ioc32.c:216:24: sparse: incompatible types in comparison expression (different address spaces)

vim +216 drivers/gpu/drm/drm_ioc32.c

   200		if (copy_from_user(&m32, argp, sizeof(m32)))
   201			return -EFAULT;
   202	
   203		map.offset = m32.offset;
   204		map.size = m32.size;
   205		map.type = m32.type;
   206		map.flags = m32.flags;
   207	
   208		err = drm_ioctl_kernel(file, drm_legacy_addmap_ioctl, &map,
   209					DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
   210		if (err)
   211			return err;
   212	
   213		m32.offset = map.offset;
   214		m32.mtrr = map.mtrr;
   215		m32.handle = ptr_to_compat(map.handle);
 > 216		if (map.handle != compat_ptr(m32.handle))
   217			pr_err_ratelimited("compat_drm_addmap truncated handle %p for type %d offset %x\n",
   218					   map.handle, m32.type, m32.offset);
   219	
   220		if (copy_to_user(argp, &m32, sizeof(m32)))
   221			return -EFAULT;
   222	
   223		return 0;
   224	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux