linux/drivers/vfio
Li RongQing d796723b14 vfio/type1: Fix error unwind in migration dirty bitmap allocation
[ Upstream commit 4518e5a60c ]

When setting up dirty page tracking at the vfio IOMMU backend for
device migration, if an error is encountered allocating a tracking
bitmap, the unwind loop fails to free previously allocated tracking
bitmaps.  This occurs because the wrong loop index is used to
generate the tracking object.  This results in unintended memory
usage for the life of the current DMA mappings where bitmaps were
successfully allocated.

Use the correct loop index to derive the tracking object for
freeing during unwind.

Fixes: d6a4c18566 ("vfio iommu: Implementation of ioctl for dirty pages tracking")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://lore.kernel.org/r/20250521034647.2877-1-lirongqing@baidu.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-06-27 11:05:13 +01:00
..
fsl-mc vfio/fsl-mc: Block calling interrupt handler without trigger 2024-04-10 16:19:30 +02:00
mdev VFIO update for v5.15-rc1 2021-09-02 13:41:33 -07:00
pci vfio/pci: Handle INTx IRQ_NOTCONNECTED 2025-06-04 14:37:56 +02:00
platform vfio/platform: check the bounds of read/write syscalls 2025-03-13 12:50:32 +01:00
Kconfig vfio: Use kconfig if XX/endif blocks instead of repeating 'depends on' 2021-08-26 10:36:51 -06:00
Makefile vfio/fsl-mc: Add VFIO framework skeleton for fsl-mc devices 2020-10-07 14:17:33 -06:00
vfio.c vfio: Clear the caps->buf to NULL after free 2022-08-25 11:40:41 +02:00
vfio_iommu_spapr_tce.c vfio/spapr_tce: convert get_user_pages() --> pin_user_pages() 2020-07-27 13:43:38 -06:00
vfio_iommu_type1.c vfio/type1: Fix error unwind in migration dirty bitmap allocation 2025-06-27 11:05:13 +01:00
vfio_spapr_eeh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
virqfd.c vfio: Introduce interface to flush virqfd inject workqueue 2024-04-10 16:19:30 +02:00