]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
octeontx2-af: Add array index check
authorAleksandr Mishin <amishin@t-argos.ru>
Thu, 28 Mar 2024 16:55:05 +0000 (19:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:54 +0000 (16:35 +0200)
commit76c39cf84cd2245305236ef71ad7896aa132c721
treeeaf074afb5aded14943fd85d386d078c98a63587
parent43b69da260af7f133df982033d2f2c01705307ca
octeontx2-af: Add array index check

commit ef15ddeeb6bee87c044bf7754fac524545bf71e8 upstream.

In rvu_map_cgx_lmac_pf() the 'iter', which is used as an array index, can reach
value (up to 14) that exceed the size (MAX_LMAC_COUNT = 8) of the array.
Fix this bug by adding 'iter' value check.

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

Fixes: 91c6945ea1f9 ("octeontx2-af: cn10k: Add RPM MAC support")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c