OpenCloudOS-Kernel/drivers/vfio/pci
Yi Liu f476dffc52 vfio/pci: Init the count variable in collecting hot-reset devices
[ Upstream commit 5a88a3f67e37e39f933b38ebb4985ba5822e9eca ]

The count variable is used without initialization, it results in mistakes
in the device counting and crashes the userspace if the get hot reset info
path is triggered.

Fixes: f6944d4a0b87 ("vfio/pci: Collect hot-reset devices to local buffer")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219010
Reported-by: Žilvinas Žaltiena <zaltys@natrix.lt>
Cc: Beld Zhang <beldzhang@gmail.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240710004150.319105-1-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-18 13:21:10 +02:00
..
hisilicon hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume 2024-01-25 15:35:55 -08:00
mlx5 VFIO updates for v6.6-rc1 2023-08-30 20:36:01 -07:00
pds vfio/pds: Make sure migration file isn't accessed after reset 2024-04-03 15:28:59 +02:00
Kconfig vfio/pds: Add Kconfig and documentation 2023-08-16 10:54:54 -06:00
Makefile vfio/pds: Initial support for pds VFIO driver 2023-08-16 10:53:00 -06:00
trace.h vfio/pci: Cleanup license mess 2019-01-22 11:06:05 -07:00
vfio_pci.c VFIO: Add the SPR_DSA and SPR_IAX devices to the denylist 2024-05-17 12:02:38 +02:00
vfio_pci_config.c vfio/pci: Also demote hiding standard cap messages 2023-05-26 13:58:27 -06:00
vfio_pci_core.c vfio/pci: Init the count variable in collecting hot-reset devices 2024-07-18 13:21:10 +02:00
vfio_pci_igd.c vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations 2023-01-23 11:26:29 -07:00
vfio_pci_intrs.c vfio/pci: fix potential memory leak in vfio_intx_enable() 2024-06-12 11:12:22 +02:00
vfio_pci_priv.h vfio/pci: Mask INTx during runtime suspend 2022-09-01 15:29:11 -06:00
vfio_pci_rdwr.c vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations 2023-01-23 11:26:29 -07:00
vfio_pci_zdev.c Merge remote-tracking branch 'mlx5/mlx5-vfio' into v6.1/vfio/next 2022-09-08 10:44:34 -06:00