]> git.itanic.dy.fi Git - linux-stable/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:30:16 +0000 (11:30 +0100)
commite6d2d26a49c3a9cd46b232975e45236304810904
treeefbc484a49840e7e7ae0cb1bec3a27683c2288a8
parent61a5df358dc32fa758b5b71a80d03c9ab823d915
net/mlx5e: Fix use-after-free when reverting termination table

[ Upstream commit 52c795af04441d76f565c4634f893e5b553df2ae ]

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: 10caabdaad5a ("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