linux/drivers/vfio
Alex Williamson bd885fcf28 vfio: Fix smatch errors in vfio_combine_iova_ranges()
smatch reports:

vfio_combine_iova_ranges() error: uninitialized symbol 'last'.
vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_end'.
vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_start'.

These errors are only reachable via invalid input, in the case of
@last when we receive an empty rb-tree or for @comb_{start,end} if the
rb-tree is empty or otherwise fails to produce a second node that
reduces the gap.  Add tests with warnings for these cases.

Reported-by: Cong Liu <liucong2@kylinos.cn>
Link: https://lore.kernel.org/all/20230920095532.88135-1-liucong2@kylinos.cn
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Link: https://lore.kernel.org/r/20231002224325.3150842-1-alex.williamson@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2023-10-09 15:56:09 -06:00
..
cdx vfio/cdx: Add parentheses between bitwise AND expression and logical NOT 2023-10-03 11:40:49 -06:00
fsl-mc vfio/fsl-mc: Use module_fsl_mc_driver macro to simplify the code 2023-08-16 11:14:15 -06:00
mdev vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() 2023-09-22 12:48:04 -06:00
pci vfio/mlx5: Activate the chunk mode functionality 2023-09-28 13:07:29 -06:00
platform vfio-iommufd: Add detach_ioas support for physical VFIO devices 2023-07-25 10:19:12 -06:00
container.c VFIO updates for v6.3-rc1 2023-02-25 11:52:57 -08:00
device_cdev.c vfio: Add VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT 2023-07-25 10:20:37 -06:00
group.c vfio: Move the IOMMU_CAP_CACHE_COHERENCY check in __vfio_register_dev() 2023-07-25 10:20:41 -06:00
iommufd.c vfio: Support IO page table replacement 2023-07-28 13:31:24 -03:00
iova_bitmap.c vfio/iova_bitmap: refactor iova_bitmap_set() to better handle page boundaries 2022-12-02 10:09:25 -07:00
Kconfig vfio: Compile vfio_group infrastructure optionally 2023-07-25 10:20:50 -06:00
Makefile vfio: Compile vfio_group infrastructure optionally 2023-07-25 10:20:50 -06:00
vfio_iommu_spapr_tce.c powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains 2023-03-15 00:51:46 +11:00
vfio_iommu_type1.c vfio: align capability structures 2023-08-17 12:17:44 -06:00
vfio_main.c vfio: Fix smatch errors in vfio_combine_iova_ranges() 2023-10-09 15:56:09 -06:00
vfio.h vfio: Compile vfio_group infrastructure optionally 2023-07-25 10:20:50 -06:00
virqfd.c vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations 2023-01-23 11:26:29 -07:00