[PATCH net] net: sparx5: Fix use after free inside sparx5_del_mact_entry

Simon Horman horms at kernel.org
Mon Mar 4 07:50:21 PST 2024


On Fri, Mar 01, 2024 at 09:06:08AM +0100, Horatiu Vultur wrote:
> Based on the static analyzis of the code it looks like when an entry
> from the MAC table was removed, the entry was still used after being
> freed. More precise the vid of the mac_entry was used after calling
> devm_kfree on the mac_entry.
> The fix consists in first using the vid of the mac_entry to delete the
> entry from the HW and after that to free it.
> 
> Fixes: b37a1bae742f ("net: sparx5: add mactable support")
> Signed-off-by: Horatiu Vultur <horatiu.vultur at microchip.com>

Reviewed-by: Simon Horman <horms at kernel.org>




More information about the linux-arm-kernel mailing list