DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 00/11] VFIO-related fixes
@ 2026-11-26 16:03 Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 01/11] bus/cdx: fix error check when enabling bus master Anatoly Burakov
                   ` (11 more replies)
  0 siblings, 12 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev

Fix a few memory leaks and other bugs in VFIO-related bus code.

Anatoly Burakov (11):
  bus/cdx: fix error check when enabling bus master
  bus/cdx: fix eventfd setup when enabling interrupts
  bus/fslmc: fix unchecked device setup for MC portal
  bus/fslmc: fix double close of MC portal device FD
  bus/fslmc: fix unchecked DPIO portal mapping
  bus/fslmc: fix DPIO portal mapping leak on close
  bus/pci: fix shared BAR info reset on mapping failure
  bus/pci: fix leaks on BAR mapping failure
  bus/pci: fix BAR area list free in secondary process
  vfio: fix uninitialized eventfds when enabling MSI-X
  vdpa/sfc: fix doorbell address in notify area query

 drivers/bus/cdx/cdx_vfio.c               | 29 ++++++++++++++-----
 drivers/bus/fslmc/fslmc_vfio.c           | 10 +++++--
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 37 ++++++++++++++++++++----
 drivers/bus/pci/linux/pci_vfio.c         | 21 +++++++-------
 drivers/vdpa/sfc/sfc_vdpa_ops.c          | 10 +++++--
 lib/eal/linux/eal_interrupts.c           |  7 ++++-
 6 files changed, 86 insertions(+), 28 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v1 01/11] bus/cdx: fix error check when enabling bus master
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 02/11] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Nipun Gupta, Nikhil Agarwal, Shubham Rohila

Currently, when setting up a CDX device, we attempt to enable bus
mastering, and we are meant to tolerate devices that do not support
configuring it, which is reported as ENOTTY. However, the check compares
errno against -ENOTTY, so the comparison can never match, and any failure
to enable bus mastering fails device setup.

Fix it by comparing against positive ENOTTY.

Fixes: 2284d67261ec ("bus/cdx: add bus master enable/disable API")
Cc: shubham.rohila@amd.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/cdx/cdx_vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index 7a554472c24..7e1f30c3764 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -268,7 +268,7 @@ cdx_vfio_setup_device(struct rte_cdx_device *dev, int vfio_dev_fd,
 	 * Enable Bus mastering for the device. errno is set as ENOTTY if
 	 * device does not support configuring bus master.
 	 */
-	if (rte_cdx_vfio_bm_enable(dev) && (errno != -ENOTTY)) {
+	if (rte_cdx_vfio_bm_enable(dev) && (errno != ENOTTY)) {
 		CDX_BUS_ERR("Bus master enable failure! Error: %d (%s)", errno,
 			strerror(errno));
 		return -1;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 02/11] bus/cdx: fix eventfd setup when enabling interrupts
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 01/11] bus/cdx: fix error check when enabling bus master Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 03/11] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Nipun Gupta, Nikhil Agarwal, Ferruh Yigit

Currently, when enabling CDX interrupts, the request tells the kernel to
set eventfds for all interrupts the device has, but only fills in an
eventfd for each vector that has one. The kernel reads every slot as a
file descriptor, so the remaining slots are uninitialized.

Also, the request lives in a fixed-size stack buffer, but the number of
slots comes from the device and is never checked against the buffer size,
so a device with enough interrupts may make the kernel read past the end of
the buffer.

Fix it by allocating the request to fit all of the device's interrupts,
and initializing slots without an efd to -1.

Fixes: f29fb5caa135 ("bus/cdx: support MSI")
Cc: nipun.gupta@amd.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/cdx/cdx_vfio.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index 7e1f30c3764..9161a5f22a1 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -573,26 +573,41 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_cdx_vfio_intr_enable)
 int
 rte_cdx_vfio_intr_enable(const struct rte_intr_handle *intr_handle)
 {
-	char irq_set_buf[MSI_IRQ_SET_BUF_LEN];
+	int nb_intr = rte_intr_nb_intr_get(intr_handle);
+	int nb_efd = rte_intr_nb_efd_get(intr_handle);
 	struct vfio_irq_set *irq_set;
 	int *fd_ptr, vfio_dev_fd, i;
+	size_t len;
 	int ret;
 
-	irq_set = (struct vfio_irq_set *) irq_set_buf;
-	irq_set->count = rte_intr_nb_intr_get(intr_handle);
-	irq_set->argsz = sizeof(struct vfio_irq_set) +
-			 (sizeof(int) * irq_set->count);
+	if (nb_intr <= 0) {
+		CDX_BUS_ERR("Invalid number of interrupts for fd %d",
+			rte_intr_fd_get(intr_handle));
+		return -1;
+	}
 
+	len = sizeof(*irq_set) + sizeof(int) * (size_t)nb_intr;
+	irq_set = calloc(1, len);
+	if (irq_set == NULL) {
+		CDX_BUS_ERR("Cannot allocate MSI interrupt request");
+		return -1;
+	}
+
+	irq_set->argsz = len;
+	irq_set->count = nb_intr;
 	irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
 	irq_set->index = 0;
 	irq_set->start = 0;
 	fd_ptr = (int *) &irq_set->data;
 
-	for (i = 0; i < rte_intr_nb_efd_get(intr_handle); i++)
+	for (i = 0; i < nb_efd; i++)
 		fd_ptr[i] = rte_intr_efds_index_get(intr_handle, i);
+	for (; i < nb_intr; i++)
+		fd_ptr[i] = -1;
 
 	vfio_dev_fd = rte_intr_dev_fd_get(intr_handle);
 	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	free(irq_set);
 
 	if (ret) {
 		CDX_BUS_ERR("Error enabling MSI interrupts for fd %d",
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 03/11] bus/fslmc: fix unchecked device setup for MC portal
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 01/11] bus/cdx: fix error check when enabling bus master Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 02/11] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 04/11] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena

Currently, when we map the MC portal object, we call into VFIO device
setup to get a device fd, but we do not check whether that succeeded. If
device setup fails before a device fd was obtained (for example, when
the group fd cannot be found), the fd variable is left uninitialized, and
we go on to issue a region info ioctl on it and then close it.

Fix it by checking the return value and bailing out early.

Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group")
Cc: hemant.agrawal@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 5ffa869e6fc..e8c6948bebb 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -1322,7 +1322,9 @@ static intptr_t vfio_map_mcp_obj(const char *mcp_obj)
 	struct vfio_device_info d_info = { .argsz = sizeof(d_info) };
 	struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
 
-	fslmc_vfio_setup_device(mcp_obj, &mc_fd, &d_info);
+	ret = fslmc_vfio_setup_device(mcp_obj, &mc_fd, &d_info);
+	if (ret != 0)
+		return v_addr;
 
 	/* getting device region info*/
 	ret = ioctl(mc_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 04/11] bus/fslmc: fix double close of MC portal device FD
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (2 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 03/11] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 05/11] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena, David Marchand

Currently, when we map the MC portal object, the device fd we get from
VFIO device setup is also recorded in the device list of its group. Once
the region is mapped we no longer need the fd, so we close it directly,
but its entry stays in the list. Since group teardown now closes every
device fd it tracks, the stale entry causes the same fd number to be
closed a second time.

Fix it by removing the device from the group instead of closing the fd
directly, which both closes the fd and drops the tracking entry.

Fixes: ba19fbe3894e ("bus/fslmc: fix some VFIO device FD and memory leaks")
Cc: david.marchand@redhat.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index e8c6948bebb..5d20b92af15 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -1317,6 +1317,7 @@ static intptr_t vfio_map_mcp_obj(const char *mcp_obj)
 {
 	intptr_t v_addr = (intptr_t)MAP_FAILED;
 	int32_t ret, mc_fd;
+	int vfio_group_fd;
 	struct vfio_group_status status = { .argsz = sizeof(status) };
 
 	struct vfio_device_info d_info = { .argsz = sizeof(d_info) };
@@ -1338,7 +1339,10 @@ static intptr_t vfio_map_mcp_obj(const char *mcp_obj)
 		mc_fd, reg_info.offset);
 
 MC_FAILURE:
-	close(mc_fd);
+	/* the group tracks this fd, removing the device also closes it */
+	vfio_group_fd = fslmc_vfio_group_fd_by_name(fslmc_vfio_get_group_name());
+	if (fslmc_vfio_group_remove_dev(vfio_group_fd, mcp_obj) != 0)
+		DPAA2_BUS_ERR("Failed to remove %s from vfio", mcp_obj);
 
 	return v_addr;
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 05/11] bus/fslmc: fix unchecked DPIO portal mapping
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (3 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 04/11] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 06/11] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena

Currently, when we create a DPIO device, we map the QBMan software
portal's cache-enabled and cache-inhibited regions, but we do not check
whether either mapping succeeded. In addition, the mappings are never
undone on the error path, so a failed probe leaks the mappings even if they
were successful.

Fix it by checking each mapping and bailing out if it failed, recording
the address only on success, and unmapping whatever was mapped on the
error path.

Fixes: 5374e50f10dc ("bus/fslmc: add dpio portal driver")
Cc: hemant.agrawal@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 35 ++++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 2e8c660acfe..67740601e6b 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -460,6 +460,19 @@ static void dpaa2_portal_finish(void *arg)
 	pthread_setspecific(dpaa2_portal_key, NULL);
 }
 
+static void
+dpaa2_unmap_dpio_portal(struct dpaa2_dpio_dev *dpio_dev)
+{
+	if (dpio_dev->qbman_portal_ce_paddr != 0) {
+		munmap((void *)dpio_dev->qbman_portal_ce_paddr, dpio_dev->ce_size);
+		dpio_dev->qbman_portal_ce_paddr = 0;
+	}
+	if (dpio_dev->qbman_portal_ci_paddr != 0) {
+		munmap((void *)dpio_dev->qbman_portal_ci_paddr, dpio_dev->ci_size);
+		dpio_dev->qbman_portal_ci_paddr = 0;
+	}
+}
+
 static void
 dpaa2_close_dpio_device(int object_id)
 {
@@ -495,6 +508,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 	struct qbman_swp_desc p_des;
 	struct dpio_attr attr;
 	int ret, object_id = obj->object_id;
+	void *addr;
 
 	if (obj_info->num_regions < NUM_DPIO_REGIONS) {
 		DPAA2_BUS_ERR("Not sufficient number of DPIO regions");
@@ -589,10 +603,14 @@ dpaa2_create_dpio_device(int vdev_fd,
 		goto err;
 	}
 
+	addr = mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED,
+			vdev_fd, reg_info.offset);
+	if (addr == MAP_FAILED) {
+		DPAA2_BUS_ERR("Failed to map DPIO CENA region: %s", strerror(errno));
+		goto err;
+	}
 	dpio_dev->ce_size = reg_info.size;
-	dpio_dev->qbman_portal_ce_paddr = (size_t)mmap(NULL, reg_info.size,
-				PROT_WRITE | PROT_READ, MAP_SHARED,
-				vdev_fd, reg_info.offset);
+	dpio_dev->qbman_portal_ce_paddr = (size_t)addr;
 
 	reg_info.index = DPAA2_SWP_CINH_REGION;
 	if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info)) {
@@ -600,10 +618,14 @@ dpaa2_create_dpio_device(int vdev_fd,
 		goto err;
 	}
 
+	addr = mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED,
+			vdev_fd, reg_info.offset);
+	if (addr == MAP_FAILED) {
+		DPAA2_BUS_ERR("Failed to map DPIO CINH region: %s", strerror(errno));
+		goto err;
+	}
 	dpio_dev->ci_size = reg_info.size;
-	dpio_dev->qbman_portal_ci_paddr = (size_t)mmap(NULL, reg_info.size,
-				PROT_WRITE | PROT_READ, MAP_SHARED,
-				vdev_fd, reg_info.offset);
+	dpio_dev->qbman_portal_ci_paddr = (size_t)addr;
 
 	/* Configure & setup SW portal */
 	p_des.block = NULL;
@@ -672,6 +694,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 		rte_free(dpio_dev->dpio);
 	}
 
+	dpaa2_unmap_dpio_portal(dpio_dev);
 	rte_intr_fd_close(dpio_dev->intr_handle);
 	/* dev_fd is closed by caller, clear reference here. */
 	rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 06/11] bus/fslmc: fix DPIO portal mapping leak on close
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (4 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 05/11] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 07/11] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena, Shreyansh Jain, Rohit Raj

Currently, when a DPIO device is closed, or when a failed DPIO probe
tears down the devices already on the list, we release the device but
never unmap its QBMan software portal regions. This leaks two mappings
per device.

Fix it by unmapping the portal regions in both places.

Fixes: e55d0494ab98 ("bus/fslmc: support secondary process")
Fixes: 274fd921ff7f ("bus/fslmc: support close operation")
Cc: shreyansh.jain@nxp.com
Cc: rohit.raj@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 67740601e6b..e7d72eac368 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -489,6 +489,7 @@ dpaa2_close_dpio_device(int object_id)
 			rte_free(dpio_dev->dpio);
 		}
 		TAILQ_REMOVE(&dpio_dev_list, dpio_dev, next);
+		dpaa2_unmap_dpio_portal(dpio_dev);
 		rte_intr_fd_close(dpio_dev->intr_handle);
 		/* dev_fd is closed by caller, clear reference here. */
 		rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
@@ -710,6 +711,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 				dpio_dev->token);
 			rte_free(dpio_dev->dpio);
 		}
+		dpaa2_unmap_dpio_portal(dpio_dev);
 		rte_intr_fd_close(dpio_dev->intr_handle);
 		/* dev_fd is closed by caller, clear reference here. */
 		rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 07/11] bus/pci: fix shared BAR info reset on mapping failure
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (5 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 06/11] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 08/11] bus/pci: fix leaks on BAR " Anatoly Burakov
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Chenbo Xia, Nipun Gupta, Miao Li, Sunil Kumar Kori,
	Yahui Cao

Currently, when mapping a sparse BAR fails, we reset the number of sparse
areas recorded for that BAR. However, BAR records live in memory that
is shared between primary and secondary processes, so when a secondary
process fails to map a BAR, it wipes the record that the primary process
and all other secondary processes rely on.

There is actually no need for the reset to begin with, because when mapping
fails in the primary process, the records are discarded anyway. Fix it
by leaving the record alone.

Fixes: f60abf9757f2 ("bus/pci: add VFIO sparse mmap")
Cc: miao.li@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 4363d7ff2c3..986b0322588 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -594,21 +594,17 @@ pci_vfio_sparse_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res,
 				if (map_addr == NULL) {
 					munmap(bar_addr, bar->size);
 					PCI_LOG(ERR, "Failed to map pci BAR%d", bar_index);
-					goto err_map;
+					return -1;
 				}
 			}
 		}
 	} else {
 		PCI_LOG(ERR, "Failed to create inaccessible mapping for BAR%d", bar_index);
-		goto err_map;
+		return -1;
 	}
 
 	bar->addr = bar_addr;
 	return 0;
-
-err_map:
-	bar->nr_areas = 0;
-	return -1;
 }
 
 /*
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 08/11] bus/pci: fix leaks on BAR mapping failure
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (6 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 07/11] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 09/11] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Chenbo Xia, Nipun Gupta, Yahui Cao, Miao Li,
	Sunil Kumar Kori

Currently, when mapping device BARs in the primary process fails, there
are two things we do not release:

- when allocating the list of sparse areas for a BAR fails, we leak region
  info for that BAR (other branches do `free(reg)`)
- when mapping a BAR fails, we release the lists of sparse areas for all
  BARs that were mapped so far, but not for the BAR that failed, because
  cleanup stops just short of it.

Fix it by releasing region info when allocation fails, and by releasing
the list of sparse areas of the failed BAR as part of cleanup.

Fixes: f60abf9757f2 ("bus/pci: add VFIO sparse mmap")
Cc: miao.li@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 986b0322588..1c88d403d25 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -863,6 +863,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
 					sizeof(*maps[i].areas) * maps[i].nr_areas, 0);
 				if (maps[i].areas == NULL) {
 					PCI_LOG(ERR, "Cannot alloc memory for sparse map areas");
+					free(reg);
 					goto err_map;
 				}
 				memcpy(maps[i].areas, sparse->areas,
@@ -913,6 +914,9 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
 		if (maps[j].nr_areas > 0)
 			rte_free(maps[j].areas);
 	}
+	/* the loop above stops short of the BAR that failed to map */
+	if (i < vfio_res->nb_maps)
+		rte_free(maps[i].areas);
 err_vfio_res:
 	rte_free(vfio_res);
 err_vfio_dev_fd:
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 09/11] bus/pci: fix BAR area list free in secondary process
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (7 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 08/11] bus/pci: fix leaks on BAR " Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 10/11] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Chenbo Xia, Nipun Gupta, Miao Li, Yahui Cao,
	Sunil Kumar Kori

Currently, when we unmap a device in a secondary process, we free the
mmap area lists of its BARs. These lists are allocated by the primary
process in shared memory and are referenced from the mapped resource
entry, which stays in the shared list after a secondary process unmaps
the device. As a result, we have use-after-free (if another process
references the list) as well as a double-free (if another process, primary
or secondary, tries to free it).

Fix it by freeing the area lists only in the primary process, where the
mapped resource entry itself is freed.

Fixes: f60abf9757f2 ("bus/pci: add VFIO sparse mmap")
Cc: miao.li@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 1c88d403d25..f4f9cad7409 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -1057,9 +1057,6 @@ find_and_unmap_vfio_resource(struct mapped_pci_res_list *vfio_res_list,
 				pci_addr, maps[i].addr);
 			pci_unmap_resource(maps[i].addr, maps[i].size);
 		}
-
-		if (maps[i].nr_areas > 0)
-			rte_free(maps[i].areas);
 	}
 
 	return vfio_res;
@@ -1072,7 +1069,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
 	struct rte_pci_addr *loc = &dev->addr;
 	struct mapped_pci_resource *vfio_res = NULL;
 	struct mapped_pci_res_list *vfio_res_list;
-	int ret, vfio_dev_fd;
+	int i, ret, vfio_dev_fd;
 
 	/* store PCI address string */
 	snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,
@@ -1113,6 +1110,10 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
 		return -1;
 	}
 
+	/* area lists are shared with secondaries, so only the primary frees them */
+	for (i = 0; i < vfio_res->nb_maps; i++)
+		rte_free(vfio_res->maps[i].areas);
+
 	TAILQ_REMOVE(vfio_res_list, vfio_res, next);
 	rte_free(vfio_res);
 	return 0;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 10/11] vfio: fix uninitialized eventfds when enabling MSI-X
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (8 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 09/11] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-26 16:03 ` [PATCH v1 11/11] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Harman Kalra, David Marchand, Cunming Liang

Currently, when we enable MSI-X interrupts, we request as many vectors as
the interrupt handle says it may have, but we only fill in eventfds for
the vectors that have them. When the interrupt handle is set up through
EAL the two always match, but a driver is free to set the maximum number
of interrupts itself, and if it is bigger than the number of eventfds in
use, the rest of the request is uninitialized.

Fix it by marking all remaining vectors as having no eventfd.

Fixes: b13bfab4cdbe ("eal: reserve VFIO vector zero for misc interrupt")
Cc: cunming.liang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/linux/eal_interrupts.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index c63956cde5c..03a0fc6ff32 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -278,7 +278,7 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 	int len, ret;
 	char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
 	struct vfio_irq_set *irq_set;
-	int *fd_ptr, vfio_dev_fd, i;
+	int *fd_ptr, vfio_dev_fd, i, nb_rxtx_vectors;
 
 	len = sizeof(irq_set_buf);
 
@@ -289,6 +289,8 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 		(rte_intr_max_intr_get(intr_handle) >
 		 RTE_MAX_RXTX_INTR_VEC_ID + 1 ?	RTE_MAX_RXTX_INTR_VEC_ID + 1 :
 		 rte_intr_max_intr_get(intr_handle)) : 1;
+	/* skip the first vector */
+	nb_rxtx_vectors = (int)irq_set->count - RTE_INTR_VEC_RXTX_OFFSET;
 
 	irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
 	irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
@@ -300,6 +302,9 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 		fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] =
 			rte_intr_efds_index_get(intr_handle, i);
 	}
+	/* vectors that have no eventfd must not be left uninitialized */
+	for (; i < nb_rxtx_vectors; i++)
+		fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] = -1;
 
 	vfio_dev_fd = rte_intr_dev_fd_get(intr_handle);
 	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 11/11] vdpa/sfc: fix doorbell address in notify area query
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (9 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 10/11] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
@ 2026-11-26 16:03 ` Anatoly Burakov
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
  11 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-26 16:03 UTC (permalink / raw)
  To: dev, Vijay Kumar Srivastava, Abhimanyu Saini, Maxime Coquelin,
	Andrew Rybchenko

Currently, when vhost asks for the notify area of a queue, we return
its offset within the VFIO device fd, which is the offset of the BAR
region within the fd plus the doorbell offset within the BAR. We then
also write to the doorbell ourselves, but we compute its address by
adding that same fd offset to the address the BAR is mapped at. This is
only correct when the region happens to be at offset zero within the fd:
otherwise, the address ends up far outside of the BAR mapping.

Fix it by adding only the doorbell offset within the BAR, and check that
the doorbell is within the BAR before writing to it.

Fixes: 2eb13ddea384 ("vdpa/sfc: fix sync between QEMU and vhost-user")
Cc: absaini@amd.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/vdpa/sfc/sfc_vdpa_ops.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c
index 84ba141b348..778cde115f8 100644
--- a/drivers/vdpa/sfc/sfc_vdpa_ops.c
+++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c
@@ -815,6 +815,7 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 	struct vfio_region_info reg = { .argsz = sizeof(reg) };
 	const efx_nic_cfg_t *encp;
 	int max_vring_cnt;
+	uint64_t bar_offset;
 	int64_t len;
 	void *dev;
 
@@ -847,7 +848,8 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 	}
 
 	/* Use bar_offset that was cached during sfc_vdpa_virtq_start() */
-	*offset = reg.offset + (uint64_t)ops_data->vq_cxt[qid].doorbell;
+	bar_offset = (uintptr_t)ops_data->vq_cxt[qid].doorbell;
+	*offset = reg.offset + bar_offset;
 
 	len = (1U << encp->enc_vi_window_shift) / 2;
 	if (len >= sysconf(_SC_PAGESIZE)) {
@@ -861,7 +863,11 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 		      *offset);
 
 	pci_dev = sfc_vdpa_adapter_by_dev_handle(dev)->pdev;
-	doorbell = (uint8_t *)pci_dev->mem_resource[reg.index].addr + *offset;
+	if (bar_offset + sizeof(uint16_t) > pci_dev->mem_resource[reg.index].len) {
+		sfc_vdpa_err(dev, "invalid doorbell offset : 0x%" PRIx64, bar_offset);
+		return -1;
+	}
+	doorbell = (uint8_t *)pci_dev->mem_resource[reg.index].addr + bar_offset;
 
 	/*
 	 * virtio-net driver in VM sends queue notifications before
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 00/13] VFIO-related fixes
  2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
                   ` (10 preceding siblings ...)
  2026-11-26 16:03 ` [PATCH v1 11/11] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov
@ 2026-11-27 13:14 ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 01/13] interrupts: fix partial event list resize Anatoly Burakov
                     ` (12 more replies)
  11 siblings, 13 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev

Fix a few memory leaks and other bugs in VFIO-related bus code.

v1 -> v2:
- Address AI feedback on nr_efd being potentially bigger than
  nr_intr by adding two patches preventing this from happening
- Move VFIO fix to earlier in the patchset

Anatoly Burakov (13):
  interrupts: fix partial event list resize
  interrupts: validate event list counts
  vfio: fix uninitialized eventfds when enabling MSI-X
  bus/cdx: fix error check when enabling bus master
  bus/cdx: fix eventfd setup when enabling interrupts
  bus/fslmc: fix unchecked device setup for MC portal
  bus/fslmc: fix double close of MC portal device FD
  bus/fslmc: fix unchecked DPIO portal mapping
  bus/fslmc: fix DPIO portal mapping leak on close
  bus/pci: fix shared BAR info reset on mapping failure
  bus/pci: fix leaks on BAR mapping failure
  bus/pci: fix BAR area list free in secondary process
  vdpa/sfc: fix doorbell address in notify area query

 app/test/test_interrupts.c               | 89 ++++++++++++++++++++++++
 drivers/bus/cdx/cdx_vfio.c               | 29 ++++++--
 drivers/bus/fslmc/fslmc_vfio.c           | 10 ++-
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 37 ++++++++--
 drivers/bus/pci/linux/pci_vfio.c         | 21 +++---
 drivers/vdpa/sfc/sfc_vdpa_ops.c          | 10 ++-
 lib/eal/common/eal_common_interrupts.c   | 53 +++++++++-----
 lib/eal/include/rte_interrupts.h         |  5 +-
 lib/eal/linux/eal_interrupts.c           |  7 +-
 9 files changed, 213 insertions(+), 48 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v2 01/13] interrupts: fix partial event list resize
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 02/13] interrupts: validate event list counts Anatoly Burakov
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Harman Kalra, Dmitry Kozlyuk, David Marchand

Resizing the eventfd list before the epoll event list can leave the handle with a smaller eventfd array and the old interrupt count if the second allocation fails. Subsequent access can then read past the end of the array.

Allocate both replacement arrays before changing the handle. Preserve the existing entries and free the original arrays only after both allocations succeed.

Fixes: 8cb5d08db940 ("interrupts: extend event list")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/common/eal_common_interrupts.c | 40 +++++++++++++++-----------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c
index f3eee636df3..3b46e90c4c3 100644
--- a/lib/eal/common/eal_common_interrupts.c
+++ b/lib/eal/common/eal_common_interrupts.c
@@ -107,6 +107,7 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_intr_event_list_update)
 int rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size)
 {
 	struct rte_epoll_event *tmp_elist;
+	size_t copy_count;
 	bool uses_rte_memory;
 	int *tmp_efds;
 
@@ -121,34 +122,41 @@ int rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size)
 	uses_rte_memory =
 		RTE_INTR_INSTANCE_USES_RTE_MEMORY(intr_handle->alloc_flags);
 	if (uses_rte_memory) {
-		tmp_efds = rte_realloc(intr_handle->efds, size * sizeof(int),
-			0);
+		tmp_efds = rte_calloc(NULL, size, sizeof(*tmp_efds), 0);
+		tmp_elist = rte_calloc(NULL, size, sizeof(*tmp_elist), 0);
 	} else {
-		tmp_efds = realloc(intr_handle->efds, size * sizeof(int));
+		tmp_efds = calloc(size, sizeof(*tmp_efds));
+		tmp_elist = calloc(size, sizeof(*tmp_elist));
 	}
-	if (tmp_efds == NULL) {
-		EAL_LOG(ERR, "Failed to realloc the efds list");
+	if (tmp_efds == NULL || tmp_elist == NULL) {
+		EAL_LOG(ERR, "Failed to allocate interrupt event lists");
+		if (uses_rte_memory) {
+			rte_free(tmp_efds);
+			rte_free(tmp_elist);
+		} else {
+			free(tmp_efds);
+			free(tmp_elist);
+		}
 		rte_errno = ENOMEM;
 		goto fail;
 	}
-	intr_handle->efds = tmp_efds;
+
+	copy_count = RTE_MIN((size_t)size, (size_t)intr_handle->nb_intr);
+	memcpy(tmp_efds, intr_handle->efds, copy_count * sizeof(*tmp_efds));
+	memcpy(tmp_elist, intr_handle->elist, copy_count * sizeof(*tmp_elist));
 	for (int i = intr_handle->nb_intr; i < size; i++)
-		intr_handle->efds[i] = -1;
+		tmp_efds[i] = -1;
 
 	if (uses_rte_memory) {
-		tmp_elist = rte_realloc(intr_handle->elist,
-			size * sizeof(struct rte_epoll_event), 0);
+		rte_free(intr_handle->efds);
+		rte_free(intr_handle->elist);
 	} else {
-		tmp_elist = realloc(intr_handle->elist,
-			size * sizeof(struct rte_epoll_event));
-	}
-	if (tmp_elist == NULL) {
-		EAL_LOG(ERR, "Failed to realloc the event list");
-		rte_errno = ENOMEM;
-		goto fail;
+		free(intr_handle->efds);
+		free(intr_handle->elist);
 	}
 	intr_handle->elist = tmp_elist;
 
+	intr_handle->efds = tmp_efds;
 	intr_handle->nb_intr = size;
 
 	return 0;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 02/13] interrupts: validate event list counts
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 01/13] interrupts: fix partial event list resize Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 03/13] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
                     ` (10 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Harman Kalra

Currently, when resizing event list counts, we only reject zero size. What
we do not check is the following:

- Negative sizes
- Sizes above UINT16_MAX (which would truncate)
- Sizes below current nb_efd or max_intr
- Sizing nb_efd above nb_intr

Fix the code to validate against these conditions.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 app/test/test_interrupts.c             | 89 ++++++++++++++++++++++++++
 lib/eal/common/eal_common_interrupts.c | 17 +++--
 lib/eal/include/rte_interrupts.h       |  5 +-
 3 files changed, 105 insertions(+), 6 deletions(-)

diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c
index 2d63a2fd986..7fa26241695 100644
--- a/app/test/test_interrupts.c
+++ b/app/test/test_interrupts.c
@@ -4,6 +4,7 @@
 
 #define ALLOW_INTERNAL_API
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <unistd.h>
@@ -498,6 +499,79 @@ test_interrupt_full_path_check(enum test_interrupt_handle_type intr_type)
 	return 0;
 }
 
+static int
+test_interrupt_event_list_resize(struct rte_intr_handle *intr_handle)
+{
+	struct rte_epoll_event event = { .fd = 123 };
+
+	TEST_ASSERT_SUCCESS(rte_intr_event_list_update(intr_handle, 2),
+		"Failed to shrink interrupt event list");
+	TEST_ASSERT_SUCCESS(rte_intr_efds_index_set(intr_handle, 1, 123),
+		"Failed to set eventfd entry before growth");
+	TEST_ASSERT_SUCCESS(rte_intr_elist_index_set(intr_handle, 1, event),
+		"Failed to set epoll event before growth");
+	TEST_ASSERT_SUCCESS(rte_intr_event_list_update(intr_handle, 4),
+		"Failed to grow interrupt event list");
+	TEST_ASSERT_EQUAL(rte_intr_efds_index_get(intr_handle, 1), 123,
+		"Growth did not preserve eventfd entry");
+	TEST_ASSERT_EQUAL(rte_intr_elist_index_get(intr_handle, 1)->fd, 123,
+		"Growth did not preserve epoll event");
+	TEST_ASSERT_EQUAL(rte_intr_efds_index_get(intr_handle, 2), -1,
+		"Growth did not initialize new eventfd entry");
+	TEST_ASSERT_EQUAL(rte_atomic_load_explicit(&rte_intr_elist_index_get(intr_handle, 2)->status,
+			rte_memory_order_relaxed), RTE_EPOLL_INVALID,
+		"Growth did not initialize new epoll event");
+	TEST_ASSERT_SUCCESS(rte_intr_efds_index_set(intr_handle, 1, -1),
+		"Failed to clear eventfd entry");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_interrupt_eventfd_counts(struct rte_intr_handle *intr_handle)
+{
+	TEST_ASSERT_SUCCESS(rte_intr_event_list_update(intr_handle, 4),
+		"Failed to resize interrupt event list");
+	TEST_ASSERT_SUCCESS(rte_intr_efds_index_set(intr_handle, 3, 123),
+		"Failed to set eventfd entry");
+	TEST_ASSERT_SUCCESS(rte_intr_nb_efd_set(intr_handle, 4),
+		"Failed to set eventfd count at capacity");
+	TEST_ASSERT_EQUAL(rte_intr_nb_efd_set(intr_handle, 5), -EINVAL,
+		"Accepted eventfd count above capacity");
+	TEST_ASSERT_EQUAL(rte_intr_nb_efd_set(intr_handle, -1), -EINVAL,
+		"Accepted negative eventfd count");
+	TEST_ASSERT_EQUAL(rte_intr_nb_efd_get(intr_handle), 4,
+		"Rejected eventfd count changed the handle");
+	TEST_ASSERT_EQUAL(rte_intr_event_list_update(intr_handle, 3), -EINVAL,
+		"Accepted resize below eventfd count");
+	TEST_ASSERT_EQUAL(rte_intr_event_list_update(intr_handle, 0), -EINVAL,
+		"Accepted zero event list size");
+	TEST_ASSERT_EQUAL(rte_intr_event_list_update(intr_handle, -1), -EINVAL,
+		"Accepted negative event list size");
+	TEST_ASSERT_EQUAL(rte_intr_event_list_update(intr_handle, UINT16_MAX + 1), -EINVAL,
+		"Accepted event list size above the interrupt count limit");
+	TEST_ASSERT_EQUAL(rte_intr_nb_intr_get(intr_handle), 4,
+		"Rejected resize changed the interrupt count");
+	TEST_ASSERT_EQUAL(rte_intr_efds_index_get(intr_handle, 3), 123,
+		"Rejected resize changed the eventfd list");
+	TEST_ASSERT_SUCCESS(rte_intr_event_list_update(intr_handle, 4),
+		"Failed to resize to the eventfd count");
+	TEST_ASSERT_SUCCESS(rte_intr_nb_efd_set(intr_handle, 0),
+		"Failed to clear eventfd count");
+	TEST_ASSERT_SUCCESS(rte_intr_max_intr_set(intr_handle, 3),
+		"Failed to set requested interrupt count");
+	TEST_ASSERT_EQUAL(rte_intr_event_list_update(intr_handle, 2), -EINVAL,
+		"Accepted resize below requested interrupt count");
+	TEST_ASSERT_EQUAL(rte_intr_nb_intr_get(intr_handle), 4,
+		"Rejected resize changed the interrupt count");
+	TEST_ASSERT_SUCCESS(rte_intr_max_intr_set(intr_handle, 0),
+		"Failed to clear requested interrupt count");
+	TEST_ASSERT_SUCCESS(rte_intr_event_list_update(intr_handle, 2),
+		"Failed to shrink after clearing eventfd count");
+
+	return TEST_SUCCESS;
+}
+
 /**
  * Main function of testing interrupt.
  */
@@ -505,6 +579,7 @@ static int
 test_interrupt(void)
 {
 	int ret = -1;
+	struct rte_intr_handle *shared_intr_handle;
 	struct rte_intr_handle *test_intr_handle;
 
 	if (RTE_EXEC_ENV_IS_WINDOWS || RTE_EXEC_ENV_IS_FREEBSD)
@@ -515,6 +590,20 @@ test_interrupt(void)
 		goto out;
 	}
 
+	if (test_interrupt_event_list_resize(intr_handles[TEST_INTERRUPT_HANDLE_INVALID]) != 0)
+		goto out;
+	shared_intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
+	if (shared_intr_handle == NULL)
+		goto out;
+	ret = test_interrupt_event_list_resize(shared_intr_handle);
+	rte_intr_instance_free(shared_intr_handle);
+	if (ret != 0)
+		goto out;
+	ret = -1;
+
+	if (test_interrupt_eventfd_counts(intr_handles[TEST_INTERRUPT_HANDLE_INVALID]) != 0)
+		goto out;
+
 	printf("Check unknown valid interrupt full path\n");
 	if (test_interrupt_full_path_check(TEST_INTERRUPT_HANDLE_VALID) < 0) {
 		printf("failure occurred during checking unknown valid "
diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c
index 3b46e90c4c3..31a9d48d7c5 100644
--- a/lib/eal/common/eal_common_interrupts.c
+++ b/lib/eal/common/eal_common_interrupts.c
@@ -113,8 +113,10 @@ int rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size)
 
 	CHECK_VALID_INTR_HANDLE(intr_handle);
 
-	if (size == 0) {
-		EAL_LOG(DEBUG, "Size can't be zero");
+	if (size <= 0 || size > UINT16_MAX || (uint32_t)size < intr_handle->nb_efd ||
+			(uint32_t)size < intr_handle->max_intr) {
+		EAL_LOG(DEBUG, "Invalid event list size %d, eventfd count %u, max interrupts %u",
+			size, intr_handle->nb_efd, intr_handle->max_intr);
 		rte_errno = EINVAL;
 		goto fail;
 	}
@@ -154,9 +156,9 @@ int rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size)
 		free(intr_handle->efds);
 		free(intr_handle->elist);
 	}
-	intr_handle->elist = tmp_elist;
-
 	intr_handle->efds = tmp_efds;
+	intr_handle->elist = tmp_elist;
+
 	intr_handle->nb_intr = size;
 
 	return 0;
@@ -317,6 +319,13 @@ int rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd)
 {
 	CHECK_VALID_INTR_HANDLE(intr_handle);
 
+	if (nb_efd < 0 || nb_efd > intr_handle->nb_intr) {
+		EAL_LOG(DEBUG, "Invalid eventfd count %d, interrupt count %d",
+			nb_efd, intr_handle->nb_intr);
+		rte_errno = EINVAL;
+		goto fail;
+	}
+
 	intr_handle->nb_efd = nb_efd;
 
 	return 0;
diff --git a/lib/eal/include/rte_interrupts.h b/lib/eal/include/rte_interrupts.h
index 85b5546dee1..904a10495ca 100644
--- a/lib/eal/include/rte_interrupts.h
+++ b/lib/eal/include/rte_interrupts.h
@@ -521,7 +521,7 @@ rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
  * @param intr_handle
  *  pointer to the interrupt handle.
  * @param nb_efd
- *  Available event fd
+ *  Number of available event fds, from zero to the interrupt vector count.
  *
  * @return
  *  - On success, zero.
@@ -768,7 +768,8 @@ rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
  * @param intr_handle
  *  pointer to the interrupt handle.
  * @param size
- *  efds and elist array size.
+ *  efds and elist array size. Must be positive, no greater than UINT16_MAX,
+ *  and at least the number of available event fds and requested interrupts.
  *
  * @return
  *  - On success, zero
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 03/13] vfio: fix uninitialized eventfds when enabling MSI-X
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 01/13] interrupts: fix partial event list resize Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 02/13] interrupts: validate event list counts Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 04/13] bus/cdx: fix error check when enabling bus master Anatoly Burakov
                     ` (9 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Harman Kalra, Cunming Liang, David Marchand

Currently, when we enable MSI-X interrupts, we request as many vectors as
the interrupt handle says it may have, but we only fill in eventfds for
the vectors that have them. When the interrupt handle is set up through
EAL the two always match, but a driver is free to set the maximum number
of interrupts itself, and if it is bigger than the number of eventfds in
use, the rest of the request is uninitialized.

Fix it by marking all remaining vectors as having no eventfd.

Fixes: b13bfab4cdbe ("eal: reserve VFIO vector zero for misc interrupt")
Cc: cunming.liang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/linux/eal_interrupts.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index c63956cde5c..03a0fc6ff32 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -278,7 +278,7 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 	int len, ret;
 	char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
 	struct vfio_irq_set *irq_set;
-	int *fd_ptr, vfio_dev_fd, i;
+	int *fd_ptr, vfio_dev_fd, i, nb_rxtx_vectors;
 
 	len = sizeof(irq_set_buf);
 
@@ -289,6 +289,8 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 		(rte_intr_max_intr_get(intr_handle) >
 		 RTE_MAX_RXTX_INTR_VEC_ID + 1 ?	RTE_MAX_RXTX_INTR_VEC_ID + 1 :
 		 rte_intr_max_intr_get(intr_handle)) : 1;
+	/* skip the first vector */
+	nb_rxtx_vectors = (int)irq_set->count - RTE_INTR_VEC_RXTX_OFFSET;
 
 	irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
 	irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
@@ -300,6 +302,9 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 		fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] =
 			rte_intr_efds_index_get(intr_handle, i);
 	}
+	/* vectors that have no eventfd must not be left uninitialized */
+	for (; i < nb_rxtx_vectors; i++)
+		fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] = -1;
 
 	vfio_dev_fd = rte_intr_dev_fd_get(intr_handle);
 	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 04/13] bus/cdx: fix error check when enabling bus master
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (2 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 03/13] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 05/13] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
                     ` (8 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Nipun Gupta, Nikhil Agarwal, Shubham Rohila

Currently, when setting up a CDX device, we attempt to enable bus
mastering, and we are meant to tolerate devices that do not support
configuring it, which is reported as ENOTTY. However, the check compares
errno against -ENOTTY, so the comparison can never match, and any failure
to enable bus mastering fails device setup.

Fix it by comparing against positive ENOTTY.

Fixes: 2284d67261ec ("bus/cdx: add bus master enable/disable API")
Cc: shubham.rohila@amd.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/cdx/cdx_vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index 7a554472c24..7e1f30c3764 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -268,7 +268,7 @@ cdx_vfio_setup_device(struct rte_cdx_device *dev, int vfio_dev_fd,
 	 * Enable Bus mastering for the device. errno is set as ENOTTY if
 	 * device does not support configuring bus master.
 	 */
-	if (rte_cdx_vfio_bm_enable(dev) && (errno != -ENOTTY)) {
+	if (rte_cdx_vfio_bm_enable(dev) && (errno != ENOTTY)) {
 		CDX_BUS_ERR("Bus master enable failure! Error: %d (%s)", errno,
 			strerror(errno));
 		return -1;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 05/13] bus/cdx: fix eventfd setup when enabling interrupts
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (3 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 04/13] bus/cdx: fix error check when enabling bus master Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 06/13] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Nipun Gupta, Nikhil Agarwal, Ferruh Yigit

Currently, when enabling CDX interrupts, the request tells the kernel to
set eventfds for all interrupts the device has, but only fills in an
eventfd for each vector that has one. The kernel reads every slot as a
file descriptor, so the remaining slots are uninitialized.

Also, the request lives in a fixed-size stack buffer, but the number of
slots comes from the device and is never checked against the buffer size,
so a device with enough interrupts may make the kernel read past the end of
the buffer.

Fix it by allocating the request to fit all of the device's interrupts,
and initializing slots without an efd to -1.

Fixes: f29fb5caa135 ("bus/cdx: support MSI")
Cc: nipun.gupta@amd.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/cdx/cdx_vfio.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index 7e1f30c3764..9161a5f22a1 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -573,26 +573,41 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_cdx_vfio_intr_enable)
 int
 rte_cdx_vfio_intr_enable(const struct rte_intr_handle *intr_handle)
 {
-	char irq_set_buf[MSI_IRQ_SET_BUF_LEN];
+	int nb_intr = rte_intr_nb_intr_get(intr_handle);
+	int nb_efd = rte_intr_nb_efd_get(intr_handle);
 	struct vfio_irq_set *irq_set;
 	int *fd_ptr, vfio_dev_fd, i;
+	size_t len;
 	int ret;
 
-	irq_set = (struct vfio_irq_set *) irq_set_buf;
-	irq_set->count = rte_intr_nb_intr_get(intr_handle);
-	irq_set->argsz = sizeof(struct vfio_irq_set) +
-			 (sizeof(int) * irq_set->count);
+	if (nb_intr <= 0) {
+		CDX_BUS_ERR("Invalid number of interrupts for fd %d",
+			rte_intr_fd_get(intr_handle));
+		return -1;
+	}
 
+	len = sizeof(*irq_set) + sizeof(int) * (size_t)nb_intr;
+	irq_set = calloc(1, len);
+	if (irq_set == NULL) {
+		CDX_BUS_ERR("Cannot allocate MSI interrupt request");
+		return -1;
+	}
+
+	irq_set->argsz = len;
+	irq_set->count = nb_intr;
 	irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
 	irq_set->index = 0;
 	irq_set->start = 0;
 	fd_ptr = (int *) &irq_set->data;
 
-	for (i = 0; i < rte_intr_nb_efd_get(intr_handle); i++)
+	for (i = 0; i < nb_efd; i++)
 		fd_ptr[i] = rte_intr_efds_index_get(intr_handle, i);
+	for (; i < nb_intr; i++)
+		fd_ptr[i] = -1;
 
 	vfio_dev_fd = rte_intr_dev_fd_get(intr_handle);
 	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	free(irq_set);
 
 	if (ret) {
 		CDX_BUS_ERR("Error enabling MSI interrupts for fd %d",
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 06/13] bus/fslmc: fix unchecked device setup for MC portal
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (4 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 05/13] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 07/13] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
                     ` (6 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena

Currently, when we map the MC portal object, we call into VFIO device
setup to get a device fd, but we do not check whether that succeeded. If
device setup fails before a device fd was obtained (for example, when
the group fd cannot be found), the fd variable is left uninitialized, and
we go on to issue a region info ioctl on it and then close it.

Fix it by checking the return value and bailing out early.

Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group")
Cc: hemant.agrawal@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 5ffa869e6fc..e8c6948bebb 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -1322,7 +1322,9 @@ static intptr_t vfio_map_mcp_obj(const char *mcp_obj)
 	struct vfio_device_info d_info = { .argsz = sizeof(d_info) };
 	struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
 
-	fslmc_vfio_setup_device(mcp_obj, &mc_fd, &d_info);
+	ret = fslmc_vfio_setup_device(mcp_obj, &mc_fd, &d_info);
+	if (ret != 0)
+		return v_addr;
 
 	/* getting device region info*/
 	ret = ioctl(mc_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 07/13] bus/fslmc: fix double close of MC portal device FD
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (5 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 06/13] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 08/13] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena, David Marchand

Currently, when we map the MC portal object, the device fd we get from
VFIO device setup is also recorded in the device list of its group. Once
the region is mapped we no longer need the fd, so we close it directly,
but its entry stays in the list. Since group teardown now closes every
device fd it tracks, the stale entry causes the same fd number to be
closed a second time.

Fix it by removing the device from the group instead of closing the fd
directly, which both closes the fd and drops the tracking entry.

Fixes: ba19fbe3894e ("bus/fslmc: fix some VFIO device FD and memory leaks")
Cc: david.marchand@redhat.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index e8c6948bebb..5d20b92af15 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -1317,6 +1317,7 @@ static intptr_t vfio_map_mcp_obj(const char *mcp_obj)
 {
 	intptr_t v_addr = (intptr_t)MAP_FAILED;
 	int32_t ret, mc_fd;
+	int vfio_group_fd;
 	struct vfio_group_status status = { .argsz = sizeof(status) };
 
 	struct vfio_device_info d_info = { .argsz = sizeof(d_info) };
@@ -1338,7 +1339,10 @@ static intptr_t vfio_map_mcp_obj(const char *mcp_obj)
 		mc_fd, reg_info.offset);
 
 MC_FAILURE:
-	close(mc_fd);
+	/* the group tracks this fd, removing the device also closes it */
+	vfio_group_fd = fslmc_vfio_group_fd_by_name(fslmc_vfio_get_group_name());
+	if (fslmc_vfio_group_remove_dev(vfio_group_fd, mcp_obj) != 0)
+		DPAA2_BUS_ERR("Failed to remove %s from vfio", mcp_obj);
 
 	return v_addr;
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 08/13] bus/fslmc: fix unchecked DPIO portal mapping
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (6 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 07/13] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 09/13] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
                     ` (4 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena

Currently, when we create a DPIO device, we map the QBMan software
portal's cache-enabled and cache-inhibited regions, but we do not check
whether either mapping succeeded. In addition, the mappings are never
undone on the error path, so a failed probe leaks the mappings even if they
were successful.

Fix it by checking each mapping and bailing out if it failed, recording
the address only on success, and unmapping whatever was mapped on the
error path.

Fixes: 5374e50f10dc ("bus/fslmc: add dpio portal driver")
Cc: hemant.agrawal@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 35 ++++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 2e8c660acfe..67740601e6b 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -460,6 +460,19 @@ static void dpaa2_portal_finish(void *arg)
 	pthread_setspecific(dpaa2_portal_key, NULL);
 }
 
+static void
+dpaa2_unmap_dpio_portal(struct dpaa2_dpio_dev *dpio_dev)
+{
+	if (dpio_dev->qbman_portal_ce_paddr != 0) {
+		munmap((void *)dpio_dev->qbman_portal_ce_paddr, dpio_dev->ce_size);
+		dpio_dev->qbman_portal_ce_paddr = 0;
+	}
+	if (dpio_dev->qbman_portal_ci_paddr != 0) {
+		munmap((void *)dpio_dev->qbman_portal_ci_paddr, dpio_dev->ci_size);
+		dpio_dev->qbman_portal_ci_paddr = 0;
+	}
+}
+
 static void
 dpaa2_close_dpio_device(int object_id)
 {
@@ -495,6 +508,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 	struct qbman_swp_desc p_des;
 	struct dpio_attr attr;
 	int ret, object_id = obj->object_id;
+	void *addr;
 
 	if (obj_info->num_regions < NUM_DPIO_REGIONS) {
 		DPAA2_BUS_ERR("Not sufficient number of DPIO regions");
@@ -589,10 +603,14 @@ dpaa2_create_dpio_device(int vdev_fd,
 		goto err;
 	}
 
+	addr = mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED,
+			vdev_fd, reg_info.offset);
+	if (addr == MAP_FAILED) {
+		DPAA2_BUS_ERR("Failed to map DPIO CENA region: %s", strerror(errno));
+		goto err;
+	}
 	dpio_dev->ce_size = reg_info.size;
-	dpio_dev->qbman_portal_ce_paddr = (size_t)mmap(NULL, reg_info.size,
-				PROT_WRITE | PROT_READ, MAP_SHARED,
-				vdev_fd, reg_info.offset);
+	dpio_dev->qbman_portal_ce_paddr = (size_t)addr;
 
 	reg_info.index = DPAA2_SWP_CINH_REGION;
 	if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info)) {
@@ -600,10 +618,14 @@ dpaa2_create_dpio_device(int vdev_fd,
 		goto err;
 	}
 
+	addr = mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED,
+			vdev_fd, reg_info.offset);
+	if (addr == MAP_FAILED) {
+		DPAA2_BUS_ERR("Failed to map DPIO CINH region: %s", strerror(errno));
+		goto err;
+	}
 	dpio_dev->ci_size = reg_info.size;
-	dpio_dev->qbman_portal_ci_paddr = (size_t)mmap(NULL, reg_info.size,
-				PROT_WRITE | PROT_READ, MAP_SHARED,
-				vdev_fd, reg_info.offset);
+	dpio_dev->qbman_portal_ci_paddr = (size_t)addr;
 
 	/* Configure & setup SW portal */
 	p_des.block = NULL;
@@ -672,6 +694,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 		rte_free(dpio_dev->dpio);
 	}
 
+	dpaa2_unmap_dpio_portal(dpio_dev);
 	rte_intr_fd_close(dpio_dev->intr_handle);
 	/* dev_fd is closed by caller, clear reference here. */
 	rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 09/13] bus/fslmc: fix DPIO portal mapping leak on close
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (7 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 08/13] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 10/13] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
                     ` (3 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Hemant Agrawal, Sachin Saxena, Shreyansh Jain, Rohit Raj

Currently, when a DPIO device is closed, or when a failed DPIO probe
tears down the devices already on the list, we release the device but
never unmap its QBMan software portal regions. This leaks two mappings
per device.

Fix it by unmapping the portal regions in both places.

Fixes: e55d0494ab98 ("bus/fslmc: support secondary process")
Fixes: 274fd921ff7f ("bus/fslmc: support close operation")
Cc: shreyansh.jain@nxp.com
Cc: rohit.raj@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 67740601e6b..e7d72eac368 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -489,6 +489,7 @@ dpaa2_close_dpio_device(int object_id)
 			rte_free(dpio_dev->dpio);
 		}
 		TAILQ_REMOVE(&dpio_dev_list, dpio_dev, next);
+		dpaa2_unmap_dpio_portal(dpio_dev);
 		rte_intr_fd_close(dpio_dev->intr_handle);
 		/* dev_fd is closed by caller, clear reference here. */
 		rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
@@ -710,6 +711,7 @@ dpaa2_create_dpio_device(int vdev_fd,
 				dpio_dev->token);
 			rte_free(dpio_dev->dpio);
 		}
+		dpaa2_unmap_dpio_portal(dpio_dev);
 		rte_intr_fd_close(dpio_dev->intr_handle);
 		/* dev_fd is closed by caller, clear reference here. */
 		rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 10/13] bus/pci: fix shared BAR info reset on mapping failure
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (8 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 09/13] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 11/13] bus/pci: fix leaks on BAR " Anatoly Burakov
                     ` (2 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Chenbo Xia, Nipun Gupta, Miao Li, Sunil Kumar Kori,
	Yahui Cao

Currently, when mapping a sparse BAR fails, we reset the number of sparse
areas recorded for that BAR. However, BAR records live in memory that
is shared between primary and secondary processes, so when a secondary
process fails to map a BAR, it wipes the record that the primary process
and all other secondary processes rely on.

There is actually no need for the reset to begin with, because when mapping
fails in the primary process, the records are discarded anyway. Fix it
by leaving the record alone.

Fixes: f60abf9757f2 ("bus/pci: add VFIO sparse mmap")
Cc: miao.li@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 4363d7ff2c3..986b0322588 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -594,21 +594,17 @@ pci_vfio_sparse_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res,
 				if (map_addr == NULL) {
 					munmap(bar_addr, bar->size);
 					PCI_LOG(ERR, "Failed to map pci BAR%d", bar_index);
-					goto err_map;
+					return -1;
 				}
 			}
 		}
 	} else {
 		PCI_LOG(ERR, "Failed to create inaccessible mapping for BAR%d", bar_index);
-		goto err_map;
+		return -1;
 	}
 
 	bar->addr = bar_addr;
 	return 0;
-
-err_map:
-	bar->nr_areas = 0;
-	return -1;
 }
 
 /*
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 11/13] bus/pci: fix leaks on BAR mapping failure
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (9 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 10/13] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 12/13] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 13/13] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Chenbo Xia, Nipun Gupta, Miao Li, Yahui Cao,
	Sunil Kumar Kori

Currently, when mapping device BARs in the primary process fails, there
are two things we do not release:

- when allocating the list of sparse areas for a BAR fails, we leak region
  info for that BAR (other branches do `free(reg)`)
- when mapping a BAR fails, we release the lists of sparse areas for all
  BARs that were mapped so far, but not for the BAR that failed, because
  cleanup stops just short of it.

Fix it by releasing region info when allocation fails, and by releasing
the list of sparse areas of the failed BAR as part of cleanup.

Fixes: f60abf9757f2 ("bus/pci: add VFIO sparse mmap")
Cc: miao.li@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 986b0322588..1c88d403d25 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -863,6 +863,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
 					sizeof(*maps[i].areas) * maps[i].nr_areas, 0);
 				if (maps[i].areas == NULL) {
 					PCI_LOG(ERR, "Cannot alloc memory for sparse map areas");
+					free(reg);
 					goto err_map;
 				}
 				memcpy(maps[i].areas, sparse->areas,
@@ -913,6 +914,9 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
 		if (maps[j].nr_areas > 0)
 			rte_free(maps[j].areas);
 	}
+	/* the loop above stops short of the BAR that failed to map */
+	if (i < vfio_res->nb_maps)
+		rte_free(maps[i].areas);
 err_vfio_res:
 	rte_free(vfio_res);
 err_vfio_dev_fd:
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 12/13] bus/pci: fix BAR area list free in secondary process
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (10 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 11/13] bus/pci: fix leaks on BAR " Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  2026-11-27 13:14   ` [PATCH v2 13/13] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Chenbo Xia, Nipun Gupta, Miao Li, Sunil Kumar Kori,
	Yahui Cao

Currently, when we unmap a device in a secondary process, we free the
mmap area lists of its BARs. These lists are allocated by the primary
process in shared memory and are referenced from the mapped resource
entry, which stays in the shared list after a secondary process unmaps
the device. As a result, we have use-after-free (if another process
references the list) as well as a double-free (if another process, primary
or secondary, tries to free it).

Fix it by freeing the area lists only in the primary process, where the
mapped resource entry itself is freed.

Fixes: f60abf9757f2 ("bus/pci: add VFIO sparse mmap")
Cc: miao.li@intel.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 1c88d403d25..f4f9cad7409 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -1057,9 +1057,6 @@ find_and_unmap_vfio_resource(struct mapped_pci_res_list *vfio_res_list,
 				pci_addr, maps[i].addr);
 			pci_unmap_resource(maps[i].addr, maps[i].size);
 		}
-
-		if (maps[i].nr_areas > 0)
-			rte_free(maps[i].areas);
 	}
 
 	return vfio_res;
@@ -1072,7 +1069,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
 	struct rte_pci_addr *loc = &dev->addr;
 	struct mapped_pci_resource *vfio_res = NULL;
 	struct mapped_pci_res_list *vfio_res_list;
-	int ret, vfio_dev_fd;
+	int i, ret, vfio_dev_fd;
 
 	/* store PCI address string */
 	snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,
@@ -1113,6 +1110,10 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
 		return -1;
 	}
 
+	/* area lists are shared with secondaries, so only the primary frees them */
+	for (i = 0; i < vfio_res->nb_maps; i++)
+		rte_free(vfio_res->maps[i].areas);
+
 	TAILQ_REMOVE(vfio_res_list, vfio_res, next);
 	rte_free(vfio_res);
 	return 0;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 13/13] vdpa/sfc: fix doorbell address in notify area query
  2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
                     ` (11 preceding siblings ...)
  2026-11-27 13:14   ` [PATCH v2 12/13] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
@ 2026-11-27 13:14   ` Anatoly Burakov
  12 siblings, 0 replies; 26+ messages in thread
From: Anatoly Burakov @ 2026-11-27 13:14 UTC (permalink / raw)
  To: dev, Vijay Kumar Srivastava, Andrew Rybchenko, Maxime Coquelin,
	Abhimanyu Saini

Currently, when vhost asks for the notify area of a queue, we return
its offset within the VFIO device fd, which is the offset of the BAR
region within the fd plus the doorbell offset within the BAR. We then
also write to the doorbell ourselves, but we compute its address by
adding that same fd offset to the address the BAR is mapped at. This is
only correct when the region happens to be at offset zero within the fd:
otherwise, the address ends up far outside of the BAR mapping.

Fix it by adding only the doorbell offset within the BAR, and check that
the doorbell is within the BAR before writing to it.

Fixes: 2eb13ddea384 ("vdpa/sfc: fix sync between QEMU and vhost-user")
Cc: absaini@amd.com
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/vdpa/sfc/sfc_vdpa_ops.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c
index 84ba141b348..778cde115f8 100644
--- a/drivers/vdpa/sfc/sfc_vdpa_ops.c
+++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c
@@ -815,6 +815,7 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 	struct vfio_region_info reg = { .argsz = sizeof(reg) };
 	const efx_nic_cfg_t *encp;
 	int max_vring_cnt;
+	uint64_t bar_offset;
 	int64_t len;
 	void *dev;
 
@@ -847,7 +848,8 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 	}
 
 	/* Use bar_offset that was cached during sfc_vdpa_virtq_start() */
-	*offset = reg.offset + (uint64_t)ops_data->vq_cxt[qid].doorbell;
+	bar_offset = (uintptr_t)ops_data->vq_cxt[qid].doorbell;
+	*offset = reg.offset + bar_offset;
 
 	len = (1U << encp->enc_vi_window_shift) / 2;
 	if (len >= sysconf(_SC_PAGESIZE)) {
@@ -861,7 +863,11 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 		      *offset);
 
 	pci_dev = sfc_vdpa_adapter_by_dev_handle(dev)->pdev;
-	doorbell = (uint8_t *)pci_dev->mem_resource[reg.index].addr + *offset;
+	if (bar_offset + sizeof(uint16_t) > pci_dev->mem_resource[reg.index].len) {
+		sfc_vdpa_err(dev, "invalid doorbell offset : 0x%" PRIx64, bar_offset);
+		return -1;
+	}
+	doorbell = (uint8_t *)pci_dev->mem_resource[reg.index].addr + bar_offset;
 
 	/*
 	 * virtio-net driver in VM sends queue notifications before
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2026-11-27 13:15 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 16:03 [PATCH v1 00/11] VFIO-related fixes Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 01/11] bus/cdx: fix error check when enabling bus master Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 02/11] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 03/11] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 04/11] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 05/11] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 06/11] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 07/11] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 08/11] bus/pci: fix leaks on BAR " Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 09/11] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 10/11] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
2026-11-26 16:03 ` [PATCH v1 11/11] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov
2026-11-27 13:14 ` [PATCH v2 00/13] VFIO-related fixes Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 01/13] interrupts: fix partial event list resize Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 02/13] interrupts: validate event list counts Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 03/13] vfio: fix uninitialized eventfds when enabling MSI-X Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 04/13] bus/cdx: fix error check when enabling bus master Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 05/13] bus/cdx: fix eventfd setup when enabling interrupts Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 06/13] bus/fslmc: fix unchecked device setup for MC portal Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 07/13] bus/fslmc: fix double close of MC portal device FD Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 08/13] bus/fslmc: fix unchecked DPIO portal mapping Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 09/13] bus/fslmc: fix DPIO portal mapping leak on close Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 10/13] bus/pci: fix shared BAR info reset on mapping failure Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 11/13] bus/pci: fix leaks on BAR " Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 12/13] bus/pci: fix BAR area list free in secondary process Anatoly Burakov
2026-11-27 13:14   ` [PATCH v2 13/13] vdpa/sfc: fix doorbell address in notify area query Anatoly Burakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox