octeontx2-pf: fix a buffer overflow in otx2_set_rxfh_context()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 May 2021 10:11:43 +0000 (13:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 May 2021 21:05:50 +0000 (14:05 -0700)
commite5cc361e21648b75f935f9571d4003aaee480214
treea14058bbd316007eda2ed971a7192d6c711b6d83
parent6e8005576648a62042a915c2bb40b450f94b6cfc
octeontx2-pf: fix a buffer overflow in otx2_set_rxfh_context()

This function is called from ethtool_set_rxfh() and "*rss_context"
comes from the user.  Add some bounds checking to prevent memory
corruption.

Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c