]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fsl/fman: Validate cell-index value obtained from Device Tree
authorAleksandr Mishin <amishin@t-argos.ru>
Mon, 28 Oct 2024 06:58:24 +0000 (09:58 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 Nov 2024 02:05:09 +0000 (19:05 -0700)
commitbd50c4125c98bd1a86f8e514872159700a9c678c
tree0c1246d87cf596cfb8785ae0c7eefa711613e4c5
parentd86c7a9162ae925dcb6632a4544c62eb0eb5c7cc
fsl/fman: Validate cell-index value obtained from Device Tree

Cell-index value is obtained from Device Tree and then used to calculate
the index for accessing arrays port_mfl[], mac_mfl[] and intr_mng[].
In case of broken DT due to any error cell-index can contain any value
and it is possible to go beyond the array boundaries which can lead
at least to memory corruption.

Validate cell-index value obtained from Device Tree.

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

Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://patch.msgid.link/20241028065824.15452-1-amishin@t-argos.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fman/fman.c
drivers/net/ethernet/freescale/fman/fman.h
drivers/net/ethernet/freescale/fman/mac.c