patch 'net/hns3: fix variable type mismatch' has been queued to stable release 21.11.5

Kevin Traynor ktraynor at redhat.com
Thu Jul 20 17:17:43 CEST 2023


Hi,

FYI, your patch has been queued to stable release 21.11.5

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

Thanks.

Kevin

---
>From 5c105051b9af46113f5798fcc5f8881b0c28554d Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui at huawei.com>
Date: Mon, 22 May 2023 21:17:38 +0800
Subject: [PATCH] net/hns3: fix variable type mismatch

[ upstream commit 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 ]

Loop conditions are compared with different variable types,
which may cause overflow risks.

Fixes: 67d010346933 ("net/hns3: adjust data type of some variables")
Fixes: 6ee07e3cb589 ("net/hns3: fix insecure way to query MAC statistics")

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
 drivers/net/hns3/hns3_regs.c  | 5 +++--
 drivers/net/hns3/hns3_stats.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
index 86a4cf74d5..95b93af733 100644
--- a/drivers/net/hns3/hns3_regs.c
+++ b/drivers/net/hns3/hns3_regs.c
@@ -295,6 +295,7 @@ hns3_direct_access_regs(struct hns3_hw *hw, uint32_t *data)
 	uint32_t *origin_data_ptr = data;
 	uint32_t reg_offset;
-	int reg_num;
-	int i, j;
+	size_t reg_num;
+	uint16_t j;
+	size_t i;
 
 	/* fetching per-PF registers values from PF PCIe register space */
diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index 767e3728f1..169bad1412 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -318,5 +318,5 @@ hns3_update_mac_stats(struct hns3_hw *hw)
 	uint64_t *desc_data;
 	uint32_t desc_num;
-	uint16_t i;
+	uint32_t i;
 	int ret;
 
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-07-20 16:17:58.921077190 +0100
+++ 0032-net-hns3-fix-variable-type-mismatch.patch	2023-07-20 16:17:54.570750136 +0100
@@ -1 +1 @@
-From 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 Mon Sep 17 00:00:00 2001
+From 5c105051b9af46113f5798fcc5f8881b0c28554d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -16,2 +17 @@
- .mailmap                      | 1 +
- drivers/net/hns3/hns3_regs.c  | 3 ++-
+ drivers/net/hns3/hns3_regs.c  | 5 +++--
@@ -19 +19 @@
- 3 files changed, 4 insertions(+), 2 deletions(-)
+ 2 files changed, 4 insertions(+), 3 deletions(-)
@@ -21,10 +20,0 @@
-diff --git a/.mailmap b/.mailmap
-index 863dbecdb0..f00c1e5457 100644
---- a/.mailmap
-+++ b/.mailmap
-@@ -302,4 +302,5 @@ Deepak Kumar Jain <deepak.k.jain at intel.com>
- Deirdre O'Connor <deirdre.o.connor at intel.com>
- Dekel Peled <dekelp at nvidia.com> <dekelp at mellanox.com>
-+Dengdui Huang <huangdengdui at huawei.com>
- Denis Pryazhennikov <denis.pryazhennikov at arknetworks.am>
- Dennis Marinus <dmarinus at amazon.com>
@@ -32 +22 @@
-index 33392fd1f0..5d6f92e4bb 100644
+index 86a4cf74d5..95b93af733 100644
@@ -38,2 +28,3 @@
--	uint16_t i, j;
- 	size_t reg_num;
+-	int reg_num;
+-	int i, j;
++	size_t reg_num;
@@ -45 +36 @@
-index bad65fcbed..c2e692a2c5 100644
+index 767e3728f1..169bad1412 100644



More information about the stable mailing list