[dpdk-stable] patch 'net/bonding: fix port ID check' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 10 15:59:36 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/16/19. 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-queue

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

Thanks.

Kevin.

---
>From 19e6ac59dd55bf040d7e6523d72a4ff826dc2b38 Mon Sep 17 00:00:00 2001
From: Junyu Jiang <junyux.jiang at intel.com>
Date: Tue, 29 Oct 2019 02:23:41 +0000
Subject: [PATCH] net/bonding: fix port ID check

[ upstream commit 588ae95e79834495f78192fc6bb3ae14c152439f ]

Port validation should be prior to getting device data
to avoid segment fault. This patch fixed the segment fault
caused by invalid port using.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")

Signed-off-by: Junyu Jiang <junyux.jiang at intel.com>
Acked-by: Chas Williams <chas3 at att.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 36 +++++++++++++++--------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 5004898e7..def27c9f1 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1301,9 +1301,10 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id,
 	struct mode8023ad_private *mode4;
 
-	bond_dev = &rte_eth_devices[port_id];
-	internals = bond_dev->data->dev_private;
-
 	if (valid_bonded_port_id(port_id) != 0)
 		return -EINVAL;
+
+	bond_dev = &rte_eth_devices[port_id];
+	internals = bond_dev->data->dev_private;
+
 	if (internals->mode != 4)
 		return -EINVAL;
@@ -1322,9 +1323,10 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id)
 	struct mode8023ad_private *mode4;
 
-	bond_dev = &rte_eth_devices[port_id];
-	internals = bond_dev->data->dev_private;
-
 	if (valid_bonded_port_id(port_id) != 0)
 		return -EINVAL;
+
+	bond_dev = &rte_eth_devices[port_id];
+	internals = bond_dev->data->dev_private;
+
 	if (internals->mode != 4)
 		return -EINVAL;
@@ -1579,7 +1581,12 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port)
 {
 	int retval = 0;
-	struct rte_eth_dev *dev = &rte_eth_devices[port];
-	struct bond_dev_private *internals = (struct bond_dev_private *)
-		dev->data->dev_private;
+	struct rte_eth_dev *dev;
+	struct bond_dev_private *internals;
+
+	if (valid_bonded_port_id(port) != 0)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port];
+	internals = dev->data->dev_private;
 
 	if (check_for_bonded_ethdev(dev) != 0)
@@ -1603,7 +1610,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port)
 {
 	int retval = 0;
-	struct rte_eth_dev *dev = &rte_eth_devices[port];
-	struct bond_dev_private *internals = (struct bond_dev_private *)
-		dev->data->dev_private;
+	struct rte_eth_dev *dev;
+	struct bond_dev_private *internals;
+
+	if (valid_bonded_port_id(port) != 0)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port];
+	internals = dev->data->dev_private;
 
 	if (check_for_bonded_ethdev(dev) != 0)
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-10 14:49:43.151229791 +0000
+++ 0062-net-bonding-fix-port-ID-check.patch	2019-12-10 14:49:39.110456686 +0000
@@ -1 +1 @@
-From 588ae95e79834495f78192fc6bb3ae14c152439f Mon Sep 17 00:00:00 2001
+From 19e6ac59dd55bf040d7e6523d72a4ff826dc2b38 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 588ae95e79834495f78192fc6bb3ae14c152439f ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index badcd109a..05b3004c4 100644
+index 5004898e7..def27c9f1 100644
@@ -24 +25 @@
-@@ -1388,9 +1388,10 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id,
+@@ -1301,9 +1301,10 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id,
@@ -38 +39 @@
-@@ -1409,9 +1410,10 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id)
+@@ -1322,9 +1323,10 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id)
@@ -52 +53 @@
-@@ -1666,7 +1668,12 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port)
+@@ -1579,7 +1581,12 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port)
@@ -68 +69 @@
-@@ -1690,7 +1697,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port)
+@@ -1603,7 +1610,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port)



More information about the stable mailing list