patch 'net/bnxt: check VF representor pointer before access' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Mon Feb 21 16:34:14 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

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

Thanks.

Kevin

---
>From 26a3e3e7d3a455defed48d20bdb73814cee7801f Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde at broadcom.com>
Date: Tue, 4 Jan 2022 14:08:24 +0530
Subject: [PATCH] net/bnxt: check VF representor pointer before access

[ upstream commit f30622542ccfe5e9ba31f67972e999c99e73385b ]

The PF or trusted VF Rx handler could invoke the VF representor's
Rx function without knowledge of the application cleaning up the
representor ports. Check if the vfr_bp pointer is valid before
accessing it.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")

Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_reps.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index 22b76b72b9..a4ab64f511 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -36,14 +36,18 @@ uint16_t
 bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
 {
-	struct rte_mbuf **prod_rx_buf;
+	struct bnxt_representor *vfr_bp = NULL;
 	struct bnxt_rx_ring_info *rep_rxr;
-	struct bnxt_rx_queue *rep_rxq;
 	struct rte_eth_dev *vfr_eth_dev;
-	struct bnxt_representor *vfr_bp;
+	struct rte_mbuf **prod_rx_buf;
+	struct bnxt_rx_queue *rep_rxq;
 	uint16_t mask;
 	uint8_t que;
 
 	vfr_eth_dev = &rte_eth_devices[port_id];
-	vfr_bp = vfr_eth_dev->data->dev_private;
+	vfr_bp = vfr_eth_dev ? vfr_eth_dev->data->dev_private : NULL;
+
+	if (unlikely(vfr_bp == NULL))
+		return 1;
+
 	/* If rxq_id happens to be > nr_rings, use ring 0 */
 	que = queue_id < vfr_bp->rx_nr_rings ? queue_id : 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-21 15:22:46.069049616 +0000
+++ 0065-net-bnxt-check-VF-representor-pointer-before-access.patch	2022-02-21 15:22:44.144704245 +0000
@@ -1 +1 @@
-From f30622542ccfe5e9ba31f67972e999c99e73385b Mon Sep 17 00:00:00 2001
+From 26a3e3e7d3a455defed48d20bdb73814cee7801f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f30622542ccfe5e9ba31f67972e999c99e73385b ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index f24f5ef75f..5e140f0cdb 100644
+index 22b76b72b9..a4ab64f511 100644



More information about the stable mailing list