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]
Date:   Sun, 9 Oct 2022 11:49:28 +0800
From:   kernel test robot <lkp@...el.com>
To:     Dan Williams <dan.j.williams@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [djbw-nvdimm:libnvdimm-pending 16/20] drivers/dax/device.c:110:38:
 sparse: sparse: incorrect type in return expression (different base types)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending
head:   911d658201acc386472f976e5fd2d48b9e45fdce
commit: 0b222ebd68c253c97aa1aca22d596ec34b3267fc [16/20] devdax: Use dax_insert_entry() + dax_delete_mapping_entry()
config: s390-randconfig-s053-20221009
compiler: s390-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git/commit/?id=0b222ebd68c253c97aa1aca22d596ec34b3267fc
        git remote add djbw-nvdimm https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git
        git fetch --no-tags djbw-nvdimm libnvdimm-pending
        git checkout 0b222ebd68c253c97aa1aca22d596ec34b3267fc
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash drivers/dax/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
>> drivers/dax/device.c:110:38: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted vm_fault_t @@     got unsigned long @@
   drivers/dax/device.c:110:38: sparse:     expected restricted vm_fault_t
   drivers/dax/device.c:110:38: sparse:     got unsigned long
   drivers/dax/device.c:166:38: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted vm_fault_t @@     got unsigned long @@
   drivers/dax/device.c:166:38: sparse:     expected restricted vm_fault_t
   drivers/dax/device.c:166:38: sparse:     got unsigned long

vim +110 drivers/dax/device.c

    75	
    76	static vm_fault_t __dev_dax_pte_fault(struct dev_dax *dev_dax,
    77					struct vm_fault *vmf)
    78	{
    79		struct address_space *mapping = vmf->vma->vm_file->f_mapping;
    80		XA_STATE(xas, &mapping->i_pages, vmf->pgoff);
    81		struct device *dev = &dev_dax->dev;
    82		phys_addr_t phys;
    83		vm_fault_t ret;
    84		void *entry;
    85		pfn_t pfn;
    86		unsigned int fault_size = PAGE_SIZE;
    87	
    88		if (check_vma(dev_dax, vmf->vma, __func__))
    89			return VM_FAULT_SIGBUS;
    90	
    91		if (dev_dax->align > PAGE_SIZE) {
    92			dev_dbg(dev, "alignment (%#x) > fault size (%#x)\n",
    93				dev_dax->align, fault_size);
    94			return VM_FAULT_SIGBUS;
    95		}
    96	
    97		if (fault_size != dev_dax->align)
    98			return VM_FAULT_SIGBUS;
    99	
   100		phys = dax_pgoff_to_phys(dev_dax, vmf->pgoff, PAGE_SIZE);
   101		if (phys == -1) {
   102			dev_dbg(dev, "pgoff_to_phys(%#lx) failed\n", vmf->pgoff);
   103			return VM_FAULT_SIGBUS;
   104		}
   105	
   106		pfn = phys_to_pfn_t(phys, PFN_DEV|PFN_MAP);
   107	
   108		entry = dax_grab_mapping_entry(&xas, mapping, 0);
   109		if (xa_is_internal(entry))
 > 110			return xa_to_internal(entry);
   111	
   112		ret = dax_insert_entry(&xas, vmf, &entry, pfn, 0);
   113	
   114		dax_unlock_entry(&xas, entry);
   115	
   116		if (ret)
   117			return ret;
   118	
   119		return vmf_insert_mixed(vmf->vma, vmf->address, pfn);
   120	}
   121	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (69251 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ