]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: qlogic/qede: fix potential out-of-bounds read in qede_tpa_cont() and qede_tpa_end()
authorPavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
Thu, 13 Nov 2025 11:27:56 +0000 (14:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:12:39 +0000 (06:12 +0900)
commita778912b4a53587ea07d85526d152f85d109cbfe
tree3a4164d4f94a283361f8f03315271b58ed37b87a
parent02d565a78d5d2304d0b222ae7009a2ea84eb6807
net: qlogic/qede: fix potential out-of-bounds read in qede_tpa_cont() and qede_tpa_end()

[ Upstream commit 896f1a2493b59beb2b5ccdf990503dbb16cb2256 ]

The loops in 'qede_tpa_cont()' and 'qede_tpa_end()', iterate
over 'cqe->len_list[]' using only a zero-length terminator as
the stopping condition. If the terminator was missing or
malformed, the loop could run past the end of the fixed-size array.

Add an explicit bound check using ARRAY_SIZE() in both loops to prevent
a potential out-of-bounds access.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 55482edc25f0 ("qede: Add slowpath/fastpath support and enable hardware GRO")
Signed-off-by: Pavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
Link: https://patch.msgid.link/20251113112757.4166625-1-Pavel.Zhigulin@kaspersky.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qede/qede_fp.c