]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Apr 2024 10:00:33 +0000 (11:00 +0100)
commitef15ddeeb6bee87c044bf7754fac524545bf71e8
treeed0ad004cc58d6300556d4061fe04f215ee0b2ca
parentc53fe72cb5fffd69f2fff104b0119d6e271759c5
octeontx2-af: Add array index check

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>
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c