Skip to contentSkip to conversation

qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE

PATCH Applied Colin King 3 participants 3 messages Jun 24, 2020 – Jun 25, 2020

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE

From: Colin Ian King <[email protected]>

The error DBG_STATUS_NO_MATCHING_FRAMING_MODE was added to the enum enum dbg_status however there is a missing corresponding entry for this in the array s_status_str. This causes an out-of-bounds read when indexing into the last entry of s_status_str. Fix this by adding in the missing entry.

Addresses-Coverity: ("Out-of-bounds read").

Fixes 2d22bc8354b1 ("qed: FW 8.42.2.0 debug features")
---
 drivers/net/ethernet/qlogic/qed/qed_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qed/qed_debug.c +2 -1
index 57a0dab88431..81e8fbe4a05b 100644
@@ -5568,7 +5568,8 @@ static const char * const s_status_str[] = {
 
 	/* DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS */
 	"The filter/trigger constraint dword offsets are not enabled for recording",
-
+	/* DBG_STATUS_NO_MATCHING_FRAMING_MODE */
+	"No matching framing mode",
 
 	/* DBG_STATUS_VFC_READ_ERROR */
 	"Error reading from VFC",
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw

From: Colin King <[email protected]>
Date: Wed, 24 Jun 2020 11:13:02 +0100

Quoted 11 lines

From: Colin Ian King <[email protected]>

The error DBG_STATUS_NO_MATCHING_FRAMING_MODE was added to the enum enum dbg_status however there is a missing corresponding entry for this in the array s_status_str. This causes an out-of-bounds read when indexing into the last entry of s_status_str. Fix this by adding in the missing entry.

Addresses-Coverity: ("Out-of-bounds read").

Fixes 2d22bc8354b1 ("qed: FW 8.42.2.0 debug features")

Applied, thank you.

#2 lore raw
In reply to Colin King

Hi Colin!

Thanks for catching this, indeed this was missed!

drivers/net/ethernet/qlogic/qed/qed_debug.c static const char * const s_status_str[] = { · line 5572

Quoted 8 lines
(quoted diff) +0 -0
 	/* DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS */
 	"The filter/trigger constraint dword offsets are not enabled for 

recording",

drivers/net/ethernet/qlogic/qed/qed_debug.c +2 -1
-
+	/* DBG_STATUS_NO_MATCHING_FRAMING_MODE */
+	"No matching framing mode",

Could you please however change the string to

"No matching framing mode found for the enabled blocks/Storms - use less
dwords for blocks data",

If you don't have much time, I can repost this for you. With this change it'll
be in sync with our internal error descriptions.

Thanks
Igor