patch 'common/qat: fix use after free in device probe' has been queued to stable release 23.11.3

Xueming Li xuemingl at nvidia.com
Mon Nov 11 07:27:01 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=67197a5768eb0b2579058cbf1862eba4c43537aa

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 67197a5768eb0b2579058cbf1862eba4c43537aa Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 8 Oct 2024 09:47:17 -0700
Subject: [PATCH] common/qat: fix use after free in device probe
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 1af60a8ce25a4a1a2ae1da6c00f432ce89a4c2eb ]

Checking return value of rte_memzone_free() is pointless
and if it failed then it was because the pointer was null.

Fixes: 7b1374b1e6e7 ("common/qat: limit configuration to primary process")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
Acked-by: Wathsala Vithanage <wathsala.vithanage at arm.com>
---
 drivers/common/qat/qat_device.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index eceb5c89c4..6901fb3aab 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -335,11 +335,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev,

 	return qat_dev;
 error:
-	if (rte_memzone_free(qat_dev_mz)) {
-		QAT_LOG(DEBUG,
-			"QAT internal error! Trying to free already allocated memzone: %s",
-			qat_dev_mz->name);
-	}
+	rte_memzone_free(qat_dev_mz);
 	return NULL;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-11 14:23:06.137913819 +0800
+++ 0015-common-qat-fix-use-after-free-in-device-probe.patch	2024-11-11 14:23:05.032192841 +0800
@@ -1 +1 @@
-From 1af60a8ce25a4a1a2ae1da6c00f432ce89a4c2eb Mon Sep 17 00:00:00 2001
+From 67197a5768eb0b2579058cbf1862eba4c43537aa Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 1af60a8ce25a4a1a2ae1da6c00f432ce89a4c2eb ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index 4a972a83bd..bca88fd9bd 100644
+index eceb5c89c4..6901fb3aab 100644
@@ -27 +29,2 @@
-@@ -390,11 +390,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
+@@ -335,11 +335,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev,
+
@@ -30 +32,0 @@
- 	rte_free(qat_dev->command_line);


More information about the stable mailing list