[dpdk-stable] patch 'net/bnxt: fix firmware version query' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:31:44 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

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

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/7ab05235227ed50335a0a4972bcb5c7e2a2cb47c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 7ab05235227ed50335a0a4972bcb5c7e2a2cb47c Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 2 Nov 2021 14:27:44 -0700
Subject: [PATCH] net/bnxt: fix firmware version query
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 211262d925268a3f5ac1c6a5a6610762b5ca5f5a ]

UBSan testing revealed undefined shift here.

The firmware returns the version in bytes; and shifting a 8 bit
quantity here can lead to undefined behaviour or truncation.
The fix is to promote the bytes to 32 bit before shifting.

Bugzilla ID: 838
Fixes: 9a891c1764ea ("net/bnxt: update HWRM to version 1.9.2")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Somnath Kotur <somnath.kotur at broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a3800cf6b1..b78e099a5e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1138,9 +1138,9 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
 		resp->hwrm_intf_upd_8b, resp->hwrm_fw_maj_8b,
 		resp->hwrm_fw_min_8b, resp->hwrm_fw_bld_8b,
 		resp->hwrm_fw_rsvd_8b);
-	bp->fw_ver = (resp->hwrm_fw_maj_8b << 24) |
-		     (resp->hwrm_fw_min_8b << 16) |
-		     (resp->hwrm_fw_bld_8b << 8) |
+	bp->fw_ver = ((uint32_t)resp->hwrm_fw_maj_8b << 24) |
+		     ((uint32_t)resp->hwrm_fw_min_8b << 16) |
+		     ((uint32_t)resp->hwrm_fw_bld_8b << 8) |
 		     resp->hwrm_fw_rsvd_8b;
 	PMD_DRV_LOG(INFO, "Driver HWRM version: %d.%d.%d\n",
 		HWRM_VERSION_MAJOR, HWRM_VERSION_MINOR, HWRM_VERSION_UPDATE);
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:11.610562375 +0800
+++ 0220-net-bnxt-fix-firmware-version-query.patch	2021-11-10 14:17:02.037411394 +0800
@@ -1 +1 @@
-From 211262d925268a3f5ac1c6a5a6610762b5ca5f5a Mon Sep 17 00:00:00 2001
+From 7ab05235227ed50335a0a4972bcb5c7e2a2cb47c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 211262d925268a3f5ac1c6a5a6610762b5ca5f5a ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index 55dcb1dd6a..3fefd558d8 100644
+index a3800cf6b1..b78e099a5e 100644
@@ -27 +29 @@
-@@ -1260,9 +1260,9 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
+@@ -1138,9 +1138,9 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)


More information about the stable mailing list