net: atlantic: verify hw_head_ lies within TX buffer ring
authorGrant Grundler <grundler@chromium.org>
Tue, 10 May 2022 02:28:26 +0000 (19:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 06:41:21 +0000 (08:41 +0200)
commitd37dc122ab078027ba427e689ef6120fa5ff5fdc
treebf256542a07469d3491ac65e83abb9ae78a42243
parent59bfc563fc33fa27b3d303b990d4dbb0a7ddd035
net: atlantic: verify hw_head_ lies within TX buffer ring

[ Upstream commit 2120b7f4d128433ad8c5f503a9584deba0684901 ]

Bounds check hw_head index provided by NIC to verify it lies
within the TX buffer ring.

Reported-by: Aashay Shringarpure <aashay@google.com>
Reported-by: Yi Chou <yich@google.com>
Reported-by: Shervin Oloumi <enlightened@google.com>
Signed-off-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c