patch 'net/ice/base: add bounds check' has been queued to stable release 21.11.9

Kevin Traynor ktraynor at redhat.com
Wed Nov 27 18:18:06 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.9

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/02/24. 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/42985910c50f05f0e47c50fe84cfe3d2ff43a32e

Thanks.

Kevin

---
>From 42985910c50f05f0e47c50fe84cfe3d2ff43a32e Mon Sep 17 00:00:00 2001
From: Fabio Pricoco <fabio.pricoco at intel.com>
Date: Mon, 14 Oct 2024 12:02:06 +0100
Subject: [PATCH] net/ice/base: add bounds check

[ upstream commit 9378aa47f45fa5cd5be219c8eb770f096e8a4c27 ]

Refactor while loop to add a check that the values read are in the
correct range.

Fixes: 6c1f26be50a2 ("net/ice/base: add control queue information")

Signed-off-by: Fabio Pricoco <fabio.pricoco at intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
 drivers/net/ice/base/ice_controlq.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c
index cdd067ce7f..541f05eb41 100644
--- a/drivers/net/ice/base/ice_controlq.c
+++ b/drivers/net/ice/base/ice_controlq.c
@@ -838,10 +838,21 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 	struct ice_sq_cd *details;
 	struct ice_aq_desc *desc;
+	u32 head;
 
 	desc = ICE_CTL_Q_DESC(*sq, ntc);
 	details = ICE_CTL_Q_DETAILS(*sq, ntc);
 
-	while (rd32(hw, cq->sq.head) != ntc) {
-		ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head));
+	head = rd32(hw, sq->head);
+	if (head >= sq->count) {
+		ice_debug(hw, ICE_DBG_AQ_MSG,
+			  "Read head value (%d) exceeds allowed range.\n",
+			  head);
+		return 0;
+	}
+
+	while (head != ntc) {
+		ice_debug(hw, ICE_DBG_AQ_MSG,
+			  "ntc %d head %d.\n",
+			  ntc, head);
 		ice_memset(desc, 0, sizeof(*desc), ICE_DMA_MEM);
 		ice_memset(details, 0, sizeof(*details), ICE_NONDMA_MEM);
@@ -851,4 +862,12 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 		desc = ICE_CTL_Q_DESC(*sq, ntc);
 		details = ICE_CTL_Q_DETAILS(*sq, ntc);
+
+		head = rd32(hw, sq->head);
+		if (head >= sq->count) {
+			ice_debug(hw, ICE_DBG_AQ_MSG,
+				  "Read head value (%d) exceeds allowed range.\n",
+				  head);
+			return 0;
+		}
 	}
 
-- 
2.47.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-27 17:17:40.116768082 +0000
+++ 0059-net-ice-base-add-bounds-check.patch	2024-11-27 17:17:38.234269420 +0000
@@ -1 +1 @@
-From 9378aa47f45fa5cd5be219c8eb770f096e8a4c27 Mon Sep 17 00:00:00 2001
+From 42985910c50f05f0e47c50fe84cfe3d2ff43a32e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9378aa47f45fa5cd5be219c8eb770f096e8a4c27 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index af27dc8542..b210495827 100644
+index cdd067ce7f..541f05eb41 100644
@@ -23,2 +24,2 @@
-@@ -840,9 +840,20 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
- 	u16 ntc = sq->next_to_clean;
+@@ -838,10 +838,21 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
+ 	struct ice_sq_cd *details;
@@ -28,0 +30 @@
+ 	details = ICE_CTL_Q_DETAILS(*sq, ntc);
@@ -45,3 +47,2 @@
- 		ntc++;
-@@ -850,4 +861,12 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
- 			ntc = 0;
+ 		ice_memset(details, 0, sizeof(*details), ICE_NONDMA_MEM);
+@@ -851,4 +862,12 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
@@ -48,0 +50 @@
+ 		details = ICE_CTL_Q_DETAILS(*sq, ntc);



More information about the stable mailing list