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]
Message-ID: <202203022116.URNbYC7D-lkp@intel.com>
Date:   Wed, 2 Mar 2022 21:10:33 +0800
From:   kernel test robot <lkp@...el.com>
To:     Nicolin Chen <nicolinc@...dia.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Liu Yi L <yi.l.liu@...el.com>
Subject: [luxis1999-iommufd:iommufd-v5.17-rc4 25/31]
 drivers/vfio/vfio.c:1160:17: warning: incompatible integer to pointer
 conversion assigning to 'void *' from 'int'

tree:   https://github.com/luxis1999/iommufd iommufd-v5.17-rc4
head:   008e1a440da8ca4e1dae3dc1c210b46cb77ce01f
commit: 6a340611dcaacc984fb82a265f0a53a28aed80e0 [25/31] vfio: Add iommufd VFIO compat support to group_fd
config: hexagon-randconfig-r045-20220302 (https://download.01.org/0day-ci/archive/20220302/202203022116.URNbYC7D-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/luxis1999/iommufd/commit/6a340611dcaacc984fb82a265f0a53a28aed80e0
        git remote add luxis1999-iommufd https://github.com/luxis1999/iommufd
        git fetch --no-tags luxis1999-iommufd iommufd-v5.17-rc4
        git checkout 6a340611dcaacc984fb82a265f0a53a28aed80e0
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/vfio/

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

All warnings (new ones prefixed by >>):

>> drivers/vfio/vfio.c:1160:17: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
           group->iommufd = vfio_group_set_iommufd(container_fd,
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +1160 drivers/vfio/vfio.c

  1146	
  1147	static int vfio_group_set_container(struct vfio_group *group, int container_fd)
  1148	{
  1149		struct fd f;
  1150		struct vfio_container *container;
  1151		struct vfio_iommu_driver *driver;
  1152		int ret = 0;
  1153	
  1154		if (atomic_read(&group->container_users))
  1155			return -EINVAL;
  1156	
  1157		if (group->type == VFIO_NO_IOMMU && !capable(CAP_SYS_RAWIO))
  1158			return -EPERM;
  1159	
> 1160		group->iommufd = vfio_group_set_iommufd(container_fd,
  1161							&group->device_list);
  1162		if (group->iommufd) {
  1163			atomic_inc(&group->container_users);
  1164			return ret;
  1165		}
  1166	
  1167		f = fdget(container_fd);
  1168		if (!f.file)
  1169			return -EBADF;
  1170	
  1171		/* Sanity check, is this really our fd? */
  1172		if (f.file->f_op != &vfio_fops) {
  1173			fdput(f);
  1174			return -EINVAL;
  1175		}
  1176	
  1177		container = f.file->private_data;
  1178		WARN_ON(!container); /* fget ensures we don't race vfio_release */
  1179	
  1180		down_write(&container->group_lock);
  1181	
  1182		/* Real groups and fake groups cannot mix */
  1183		if (!list_empty(&container->group_list) &&
  1184		    container->noiommu != (group->type == VFIO_NO_IOMMU)) {
  1185			ret = -EPERM;
  1186			goto unlock_out;
  1187		}
  1188	
  1189		ret = iommu_group_claim_dma_owner(group->iommu_group, f.file);
  1190		if (ret)
  1191			goto unlock_out;
  1192	
  1193		driver = container->iommu_driver;
  1194		if (driver) {
  1195			ret = driver->ops->attach_group(container->iommu_data,
  1196							group->iommu_group,
  1197							group->type);
  1198			if (ret) {
  1199				iommu_group_release_dma_owner(group->iommu_group);
  1200				goto unlock_out;
  1201			}
  1202		}
  1203	
  1204		group->container = container;
  1205		container->noiommu = (group->type == VFIO_NO_IOMMU);
  1206		list_add(&group->container_next, &container->group_list);
  1207	
  1208		/* Get a reference on the container and mark a user within the group */
  1209		vfio_container_get(container);
  1210		atomic_inc(&group->container_users);
  1211	
  1212	unlock_out:
  1213		up_write(&container->group_lock);
  1214		fdput(f);
  1215		return ret;
  1216	}
  1217	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ