patch 'ethdev: fix crash on owner delete' has been queued to stable release 19.11.11
christian.ehrhardt at canonical.com
christian.ehrhardt at canonical.com
Tue Nov 30 17:35:26 CET 2021
Hi,
FYI, your patch has been queued to stable release 19.11.11
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/d3ccaea9fd142fe5fd42523ba9e79148319cb9db
Thanks.
Christian Ehrhardt <christian.ehrhardt at canonical.com>
---
>From d3ccaea9fd142fe5fd42523ba9e79148319cb9db Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Thu, 4 Nov 2021 11:04:21 +0000
Subject: [PATCH] ethdev: fix crash on owner delete
[ upstream commit b7ade5d31a747fc044a9816b38814b47a6e1b201 ]
'eth_dev->data' can be null before ethdev allocated. The API walks
through all eth devices, at least for some data can be null.
Adding 'eth_dev->data' null check before accessing it.
Fixes: 33c73aae32e4 ("ethdev: allow ownership operations on unused port")
Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Chenbo Xia <chenbo.xia at intel.com>
Acked-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
---
lib/librte_ethdev/rte_ethdev.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a51a902f04..abcc31c19e 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -702,10 +702,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id)
rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);
if (rte_eth_is_valid_owner_id(owner_id)) {
- for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++)
- if (rte_eth_devices[port_id].data->owner.id == owner_id)
- memset(&rte_eth_devices[port_id].data->owner, 0,
+ for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {
+ struct rte_eth_dev_data *data =
+ rte_eth_devices[port_id].data;
+ if (data != NULL && data->owner.id == owner_id)
+ memset(&data->owner, 0,
sizeof(struct rte_eth_dev_owner));
+ }
RTE_ETHDEV_LOG(NOTICE,
"All port owners owned by %016"PRIx64" identifier have removed\n",
owner_id);
--
2.34.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-11-30 16:50:13.088309076 +0100
+++ 0122-ethdev-fix-crash-on-owner-delete.patch 2021-11-30 16:50:05.950874704 +0100
@@ -1 +1 @@
-From b7ade5d31a747fc044a9816b38814b47a6e1b201 Mon Sep 17 00:00:00 2001
+From d3ccaea9fd142fe5fd42523ba9e79148319cb9db Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b7ade5d31a747fc044a9816b38814b47a6e1b201 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
- lib/ethdev/rte_ethdev.c | 9 ++++++---
+ lib/librte_ethdev/rte_ethdev.c | 9 ++++++---
@@ -22,6 +23,6 @@
-diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
-index 7db84b12d0..8e679e4003 100644
---- a/lib/ethdev/rte_ethdev.c
-+++ b/lib/ethdev/rte_ethdev.c
-@@ -757,10 +757,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id)
- rte_spinlock_lock(ð_dev_shared_data->ownership_lock);
+diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
+index a51a902f04..abcc31c19e 100644
+--- a/lib/librte_ethdev/rte_ethdev.c
++++ b/lib/librte_ethdev/rte_ethdev.c
+@@ -702,10 +702,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id)
+ rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);
@@ -29 +30 @@
- if (eth_is_valid_owner_id(owner_id)) {
+ if (rte_eth_is_valid_owner_id(owner_id)) {
More information about the stable
mailing list