[dpdk-stable] patch 'cryptodev: fix freeing after device release' has been queued to stable release 19.11.10
christian.ehrhardt at canonical.com
christian.ehrhardt at canonical.com
Tue Aug 10 17:40:19 CEST 2021
Hi,
FYI, your patch has been queued to stable release 19.11.10
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. 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/cpaelzer/dpdk-stable-queue
This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/8d586e78ec35caa18df292a704d04a3d68be84e6
Thanks.
Christian Ehrhardt <christian.ehrhardt at canonical.com>
---
>From 8d586e78ec35caa18df292a704d04a3d68be84e6 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power at intel.com>
Date: Wed, 21 Jul 2021 12:51:22 +0000
Subject: [PATCH] cryptodev: fix freeing after device release
[ upstream commit eeaeca82b8cbd6599bafd4029aad5ce4dedff7a2 ]
The PMD destroy function was calling the release function, which frees
cryptodev->data, and then tries to free cryptodev->data->dev_private,
which causes the heap use after free issue.
A temporary pointer is set before the free of cryptodev->data,
which can then be used afterwards to free dev_private.
The free cannot be moved to before the release function is called,
as dev_private is used in the PMD close function while being released.
Fixes: 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation")
Reported-by: Zhihong Peng <zhihongx.peng at intel.com>
Signed-off-by: Ciara Power <ciara.power at intel.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
lib/librte_cryptodev/rte_cryptodev_pmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
index 0912004127..e342daabc4 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -140,6 +140,7 @@ int
rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
{
int retval;
+ void *dev_priv = cryptodev->data->dev_private;
CDEV_LOG_INFO("Closing crypto device %s", cryptodev->device->name);
@@ -149,7 +150,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
return retval;
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
- rte_free(cryptodev->data->dev_private);
+ rte_free(dev_priv);
cryptodev->device = NULL;
--
2.32.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-08-10 15:11:16.801842195 +0200
+++ 0099-cryptodev-fix-freeing-after-device-release.patch 2021-08-10 15:11:13.130638908 +0200
@@ -1 +1 @@
-From eeaeca82b8cbd6599bafd4029aad5ce4dedff7a2 Mon Sep 17 00:00:00 2001
+From 8d586e78ec35caa18df292a704d04a3d68be84e6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit eeaeca82b8cbd6599bafd4029aad5ce4dedff7a2 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
- lib/cryptodev/rte_cryptodev_pmd.c | 3 ++-
+ lib/librte_cryptodev/rte_cryptodev_pmd.c | 3 ++-
@@ -25 +26 @@
-diff --git a/lib/cryptodev/rte_cryptodev_pmd.c b/lib/cryptodev/rte_cryptodev_pmd.c
+diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -27,2 +28,2 @@
---- a/lib/cryptodev/rte_cryptodev_pmd.c
-+++ b/lib/cryptodev/rte_cryptodev_pmd.c
+--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
++++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
More information about the stable
mailing list