Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0df8adbb authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

qed: off by one in qed_parse_mcp_trace_buf()



If format_idx == s_mcp_trace_meta.formats_num then we read one element
beyond the end of the s_mcp_trace_meta.formats[] array.

Fixes: 50bc60cb ("qed*: Utilize FW 8.33.11.0")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarTomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5e7ba042
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6723,7 +6723,7 @@ static enum dbg_status qed_parse_mcp_trace_buf(u8 *trace_buf,
		format_idx = header & MFW_TRACE_EVENTID_MASK;

		/* Skip message if its index doesn't exist in the meta data */
		if (format_idx > s_mcp_trace_meta.formats_num) {
		if (format_idx >= s_mcp_trace_meta.formats_num) {
			u8 format_size =
				(u8)((header & MFW_TRACE_PRM_SIZE_MASK) >>
				     MFW_TRACE_PRM_SIZE_SHIFT);