[paragon-software-group-ntfs3:master 35/42] fs/ntfs3/frecord.c:1934:16: sparse: sparse: incorrect type in argument 1 (different address spaces)

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

 



tree:   https://github.com/Paragon-Software-Group/linux-ntfs3.git master
head:   bde63e8eae5d67582b32517229de11ef00223e34
commit: 27ba86795ed65b6f2f88f1b63786fe68c57b3b61 [35/42] fs/ntfs3: Do copy_to_user out of run_lock
config: nios2-randconfig-r111-20240627 (https://download.01.org/0day-ci/archive/20240627/202406271920.hndE8N6D-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240627/202406271920.hndE8N6D-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406271920.hndE8N6D-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> fs/ntfs3/frecord.c:1934:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *d @@     got struct fiemap_extent [noderef] __user *[assigned] dest @@
   fs/ntfs3/frecord.c:1934:16: sparse:     expected void *d
   fs/ntfs3/frecord.c:1934:16: sparse:     got struct fiemap_extent [noderef] __user *[assigned] dest
   fs/ntfs3/frecord.c:2011:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct fiemap_extent [noderef] __user *fi_extents_start @@     got struct fiemap_extent *[assigned] fe_k @@
   fs/ntfs3/frecord.c:2011:35: sparse:     expected struct fiemap_extent [noderef] __user *fi_extents_start
   fs/ntfs3/frecord.c:2011:35: sparse:     got struct fiemap_extent *[assigned] fe_k
   fs/ntfs3/frecord.c: note: in included file:
   fs/ntfs3/ntfs.h:461:21: sparse: sparse: self-comparison always evaluates to false

vim +1934 fs/ntfs3/frecord.c

  1900	
  1901	/*
  1902	 * fiemap_fill_next_extent_k - a copy of fiemap_fill_next_extent
  1903	 * but it accepts kernel address for fi_extents_start
  1904	 */
  1905	static int fiemap_fill_next_extent_k(struct fiemap_extent_info *fieinfo,
  1906					     u64 logical, u64 phys, u64 len, u32 flags)
  1907	{
  1908		struct fiemap_extent extent;
  1909		struct fiemap_extent __user *dest = fieinfo->fi_extents_start;
  1910	
  1911		/* only count the extents */
  1912		if (fieinfo->fi_extents_max == 0) {
  1913			fieinfo->fi_extents_mapped++;
  1914			return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0;
  1915		}
  1916	
  1917		if (fieinfo->fi_extents_mapped >= fieinfo->fi_extents_max)
  1918			return 1;
  1919	
  1920		if (flags & FIEMAP_EXTENT_DELALLOC)
  1921			flags |= FIEMAP_EXTENT_UNKNOWN;
  1922		if (flags & FIEMAP_EXTENT_DATA_ENCRYPTED)
  1923			flags |= FIEMAP_EXTENT_ENCODED;
  1924		if (flags & (FIEMAP_EXTENT_DATA_TAIL | FIEMAP_EXTENT_DATA_INLINE))
  1925			flags |= FIEMAP_EXTENT_NOT_ALIGNED;
  1926	
  1927		memset(&extent, 0, sizeof(extent));
  1928		extent.fe_logical = logical;
  1929		extent.fe_physical = phys;
  1930		extent.fe_length = len;
  1931		extent.fe_flags = flags;
  1932	
  1933		dest += fieinfo->fi_extents_mapped;
> 1934		memcpy(dest, &extent, sizeof(extent));
  1935	
  1936		fieinfo->fi_extents_mapped++;
  1937		if (fieinfo->fi_extents_mapped == fieinfo->fi_extents_max)
  1938			return 1;
  1939		return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0;
  1940	}
  1941	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux