patch 'dma/idxd: fix null dereference in PCI remove' has been queued to stable release 21.11.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Jul 6 22:35:03 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/08/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/e1c3685b21e1d764026c305cb5db605b3cf9707c

Thanks.

Luca Boccassi

---
>From e1c3685b21e1d764026c305cb5db605b3cf9707c Mon Sep 17 00:00:00 2001
From: Kevin Laatz <kevin.laatz at intel.com>
Date: Mon, 4 Jul 2022 16:27:51 +0100
Subject: [PATCH] dma/idxd: fix null dereference in PCI remove

[ upstream commit b29427649b6d51b3b49187cbaeaa6587ce80ce72 ]

The 'info' struct was being declared as a NULL pointer. If a NULL
pointer is passed to 'rte_dma_info_get', EINVAL is returned and the
struct is not populated. This subsequently causes a segfault when
dereferencing 'info'.

This patch fixes the issue by simply declaring 'info' on the stack and
passing its address to 'rte_dma_info_get'.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")

Signed-off-by: Kevin Laatz <kevin.laatz at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/dma/idxd/idxd_pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c
index 2c3b01cd2b..2f8ec06d9e 100644
--- a/drivers/dma/idxd/idxd_pci.c
+++ b/drivers/dma/idxd/idxd_pci.c
@@ -380,10 +380,10 @@ idxd_dmadev_remove_pci(struct rte_pci_device *dev)
 	IDXD_PMD_INFO("Closing %s on NUMA node %d", name, dev->device.numa_node);
 
 	RTE_DMA_FOREACH_DEV(i) {
-		struct rte_dma_info *info = {0};
-		rte_dma_info_get(i, info);
-		if (strncmp(name, info->dev_name, strlen(name)) == 0)
-			idxd_dmadev_destroy(info->dev_name);
+		struct rte_dma_info info;
+		rte_dma_info_get(i, &info);
+		if (strncmp(name, info.dev_name, strlen(name)) == 0)
+			idxd_dmadev_destroy(info.dev_name);
 	}
 
 	return 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-06 21:07:54.526572965 +0100
+++ 0028-dma-idxd-fix-null-dereference-in-PCI-remove.patch	2022-07-06 21:07:53.579519398 +0100
@@ -1 +1 @@
-From b29427649b6d51b3b49187cbaeaa6587ce80ce72 Mon Sep 17 00:00:00 2001
+From e1c3685b21e1d764026c305cb5db605b3cf9707c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b29427649b6d51b3b49187cbaeaa6587ce80ce72 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list