[dpdk-stable] patch 'net/bnxt: fix dereference before null check' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 3 19:27:13 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/10/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/b661bfd5a01e3f28e60faa825e6ea5b599a3c980

Thanks.

Kevin.

---
>From b661bfd5a01e3f28e60faa825e6ea5b599a3c980 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Wed, 9 Oct 2019 14:16:17 +0530
Subject: [PATCH] net/bnxt: fix dereference before null check

[ upstream commit 5e592e8d4091da4ad1faadd9c3719bd4c245cca4 ]

This patch fixes potential null pointer access in bnxt_alloc_ag_data().
Fix to return an error if null check is true.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")

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

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 88ea94214..918a7ae87 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -62,15 +62,19 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
 	struct rte_mbuf *mbuf;
 
-	mbuf = __bnxt_alloc_rx_data(rxq->mb_pool);
-	if (!mbuf) {
-		rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail);
-		return -ENOMEM;
-	}
-
-	if (rxbd == NULL)
+	if (rxbd == NULL) {
 		PMD_DRV_LOG(ERR, "Jumbo Frame. rxbd is NULL\n");
-	if (rx_buf == NULL)
+		return -EINVAL;
+	}
+
+	if (rx_buf == NULL) {
 		PMD_DRV_LOG(ERR, "Jumbo Frame. rx_buf is NULL\n");
+		return -EINVAL;
+	}
 
+	mbuf = __bnxt_alloc_rx_data(rxq->mb_pool);
+	if (!mbuf) {
+		rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail);
+		return -ENOMEM;
+	}
 
 	rx_buf->mbuf = mbuf;
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-03 17:29:55.445418677 +0000
+++ 0064-net-bnxt-fix-dereference-before-null-check.patch	2019-12-03 17:29:51.798748954 +0000
@@ -1 +1 @@
-From 5e592e8d4091da4ad1faadd9c3719bd4c245cca4 Mon Sep 17 00:00:00 2001
+From b661bfd5a01e3f28e60faa825e6ea5b599a3c980 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5e592e8d4091da4ad1faadd9c3719bd4c245cca4 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index f0f9b020b..03dae571b 100644
+index 88ea94214..918a7ae87 100644
@@ -23 +24 @@
-@@ -64,15 +64,19 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
+@@ -62,15 +62,19 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,



More information about the stable mailing list