]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix use-after-free when reverting termination table
authorRoi Dayan <roid@nvidia.com>
Mon, 14 Nov 2022 18:04:29 +0000 (20:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:02 +0000 (11:23 +0100)
commit5453de8c3d35bae45db6dc868dbadb11cba55d67
tree7c43c429ddb1bd8f8e7451cb6b5f0bb270a7c7a8
parent32420b9c9294726e567683a4a878ceb8263d7bab
net/mlx5e: Fix use-after-free when reverting termination table

[ Upstream commit 0724862f0be665f4adde04adaf7bf86566f12551 ]

When having multiple dests with termination tables and second one
or afterwards fails the driver reverts usage of term tables but
doesn't reset the assignment in attr->dests[num_vport_dests].termtbl
which case a use-after-free when releasing the rule.
Fix by resetting the assignment of termtbl to null.

Fixes: fb7a82126eb6 ("net/mlx5e: Use termination table for VLAN push actions")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c