patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch 'net/txgbe: fix out of bound access' has been queued to stable release 21.11.6
@ 2023-12-07 11:20 Kevin Traynor
  2023-12-07 11:20 ` patch 'doc: fix hns3 build option about max queue number' " Kevin Traynor
                   ` (20 more replies)
  0 siblings, 21 replies; 25+ messages in thread
From: Kevin Traynor @ 2023-12-07 11:20 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Luca Boccassi, Jiawen Wu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.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/12/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/d549330dfcbdfa5c0a5018592188d2737ae9c743

Thanks.

Kevin

---
From d549330dfcbdfa5c0a5018592188d2737ae9c743 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Fri, 17 Nov 2023 10:12:04 +0000
Subject: [PATCH] net/txgbe: fix out of bound access

[ upstream commit 4a2ba73b1d1a76a4c270aa34af22229172a7f387 ]

Reported by SuSe CI [1] by GCC [2], possibly false positive. Error:

 In function 'txgbe_host_interface_command',
     inlined from 'txgbe_host_interface_command'
             at ../drivers/net/txgbe/base/txgbe_mng.c:104:1,
     inlined from 'txgbe_hic_reset'
             at ../drivers/net/txgbe/base/txgbe_mng.c:345:9:
 ../drivers/net/txgbe/base/txgbe_mng.c:145:36:
    error: array subscript 2 is outside array bounds ofr
           'struct txgbe_hic_reset[1]' [-Werror=array-bounds=]
   145 |                     buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi);
 ../drivers/net/txgbe/base/txgbe_mng.c: In function 'txgbe_hic_reset':
 ../drivers/net/txgbe/base/txgbe_mng.c:331:32:
    note: at offset 8 into object 'reset_cmd' of size 8
   331 |         struct txgbe_hic_reset reset_cmd;
       |                                ^~~~~~~~~

Access to buffer done based on command code, the case complained by
FW_RESET_CMD has short buffer but this code path only taken with command
0x30, so this shouldn't be a problem.

Command 0x30 no more used, removing this exception check that cause
build error.

[1]
https://build.opensuse.org/public/build/home:bluca:dpdk/openSUSE_Factory_ARM/armv7l/dpdk-20.11/_log

[2]
gcc 13.2.1 "cc (SUSE Linux) 13.2.1 20230912

Fixes: 35c90ecccfd4 ("net/txgbe: add EEPROM functions")

Reported-by: Luca Boccassi <luca.boccassi@microsoft.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Reviewed-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_mng.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_mng.c b/drivers/net/txgbe/base/txgbe_mng.c
index 045a2f5de0..6255718ff7 100644
--- a/drivers/net/txgbe/base/txgbe_mng.c
+++ b/drivers/net/txgbe/base/txgbe_mng.c
@@ -137,19 +137,5 @@ txgbe_host_interface_command(struct txgbe_hw *hw, u32 *buffer,
 		buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi);
 
-	/*
-	 * If there is any thing in data position pull it in
-	 * Read Flash command requires reading buffer length from
-	 * two byes instead of one byte
-	 */
-	if (resp->cmd == 0x30) {
-		for (; bi < dword_len + 2; bi++)
-			buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi);
-
-		buf_len = (((u16)(resp->cmd_or_resp.ret_status) << 3)
-				  & 0xF00) | resp->buf_len;
-		hdr_size += (2 << 2);
-	} else {
-		buf_len = resp->buf_len;
-	}
+	buf_len = resp->buf_len;
 	if (!buf_len)
 		goto rel_out;
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-07 11:18:59.670721969 +0000
+++ 0001-net-txgbe-fix-out-of-bound-access.patch	2023-12-07 11:18:59.606873856 +0000
@@ -1 +1 @@
-From 4a2ba73b1d1a76a4c270aa34af22229172a7f387 Mon Sep 17 00:00:00 2001
+From d549330dfcbdfa5c0a5018592188d2737ae9c743 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4a2ba73b1d1a76a4c270aa34af22229172a7f387 ]
+
@@ -37 +38,0 @@
-Cc: stable@dpdk.org
@@ -47 +48 @@
-index df7145094f..029a0a1fe1 100644
+index 045a2f5de0..6255718ff7 100644
@@ -50 +51 @@
-@@ -142,19 +142,5 @@ txgbe_host_interface_command(struct txgbe_hw *hw, u32 *buffer,
+@@ -137,19 +137,5 @@ txgbe_host_interface_command(struct txgbe_hw *hw, u32 *buffer,


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-12-11 15:28 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 11:20 patch 'net/txgbe: fix out of bound access' has been queued to stable release 21.11.6 Kevin Traynor
2023-12-07 11:20 ` patch 'doc: fix hns3 build option about max queue number' " Kevin Traynor
2023-12-07 11:20 ` patch 'doc: update features in hns3 guide' " Kevin Traynor
2023-12-07 11:20 ` patch 'doc: fix RSS flow description " Kevin Traynor
2023-12-07 11:20 ` patch 'doc: update versions recommendations for i40e and ice' " Kevin Traynor
2023-12-07 11:20 ` patch 'examples/ipsec-secgw: fix partial overflow' " Kevin Traynor
2023-12-07 11:20 ` patch 'eal/windows: fix build with recent MinGW' " Kevin Traynor
2023-12-07 11:21 ` patch 'pdump: fix error number on IPC response' " Kevin Traynor
2023-12-07 11:21 ` patch 'app/dumpcap: allow multiple invocations' " Kevin Traynor
2023-12-07 11:21 ` patch 'examples/ethtool: fix pause configuration' " Kevin Traynor
2023-12-07 11:21 ` patch 'test/hash: fix creation error log' " Kevin Traynor
2023-12-07 11:21 ` patch 'app/pipeline: add sigint handler' " Kevin Traynor
2023-12-07 11:21 ` patch 'doc: remove restriction on ixgbe vector support' " Kevin Traynor
2023-12-07 11:21 ` patch 'doc: fix some ordered lists' " Kevin Traynor
2023-12-07 11:21 ` patch 'doc: remove number of commands in vDPA guide' " Kevin Traynor
2023-12-07 11:21 ` patch 'mempool: fix get function documentation' " Kevin Traynor
2023-12-07 11:21 ` patch 'mempool: clarify enqueue/dequeue ops " Kevin Traynor
2023-12-07 11:21 ` patch 'ethdev: fix ESP packet type description' " Kevin Traynor
2023-12-07 11:21 ` patch 'net/hns3: fix ignored reset event' " Kevin Traynor
2023-12-07 11:21 ` patch 'net/hns3: fix reset event status' " Kevin Traynor
2023-12-07 11:21 ` patch 'net/hns3: fix VF reset handler interruption' " Kevin Traynor
2023-12-07 11:21 ` patch 'net/af_xdp: make compatible with libbpf 0.8.0' " Kevin Traynor
2023-12-07 14:16   ` Kevin Traynor
2023-12-11 12:44     ` Loftus, Ciara
2023-12-11 15:27       ` Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).