]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ethernet: mtk_eth_soc: out of bounds read in mtk_hwlro_get_fdir_entry()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 May 2022 08:02:42 +0000 (11:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:53:57 +0000 (16:53 +0200)
commit5ba81f82607ead85fe36f50869fc4f5661359ab8
treec4e1caffd2fab3a7b2089275316948af8239d049
parentc73d6e3cc33c6b48e0c9f12440cdaaabfe12fcdf
net: ethernet: mtk_eth_soc: out of bounds read in mtk_hwlro_get_fdir_entry()

[ Upstream commit e7e7104e2d5ddf3806a28695670f21bef471f1e1 ]

The "fsp->location" variable comes from user via ethtool_get_rxnfc().
Check that it is valid to prevent an out of bounds read.

Fixes: 7aab747e5563 ("net: ethernet: mediatek: add ethtool functions to configure RX flows of HW LRO")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mediatek/mtk_eth_soc.c