qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE
PATCH v2 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").
---
V2: use the error message as suggested by Igor Russkikh
--- drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qed/qed_debug.c +2 -0
@@ -5569,6 +5569,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 found for the enabled blocks/Storms - use less dwords for blocks data" ,/* DBG_STATUS_VFC_READ_ERROR */ "Error reading from VFC",
Signature · 1 line
2.27.0
Quoted 11 lines · Colin King
External Email
----------------------------------------------------------------------
From: Colin Ian King <[email protected]>The error
DBG_STATUS_NO_MATCHING_FRAMING_MODEwas added to the enum enumdbg_statushowever there is a missing corresponding entry for this in the arrays_status_str. This causes an out-of-bounds read when indexing into the last entry ofs_status_str. Fix this by adding in the missing entry.
Quoted 8 lines
Addresses-Coverity: ("Out-of-bounds read").
Fixes 2d22bc8354b1 ("qed: FW 8.42.2.0 debug features")Signed-off-by Colin Ian King <[email protected]>---
V2: use the error message as suggested by Igor Russkikh
---
Thanks!
David Miller
maintainerFrom: Colin King <[email protected]>
Date: Thu, 25 Jun 2020 17:45:05 +0100
Quoted 8 lines
From: Colin Ian King <[email protected]>
The error
DBG_STATUS_NO_MATCHING_FRAMING_MODEwas added to the enum enumdbg_statushowever there is a missing corresponding entry for this in the arrays_status_str. This causes an out-of-bounds read when indexing into the last entry ofs_status_str. Fix this by adding in the missing entry.
Quoted 6 lines
Addresses-Coverity: ("Out-of-bounds read").
Fixes 2d22bc8354b1 ("qed: FW 8.42.2.0 debug features")Signed-off-by Colin Ian King <[email protected]>---
V2: use the error message as suggested by Igor Russkikh
I already applied your V1 so this patch no longer applies.