]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Always clear dest encap in neigh-update-del
authorChris Mi <cmi@nvidia.com>
Mon, 5 Dec 2022 01:22:50 +0000 (09:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:00:36 +0000 (12:00 +0100)
commit27242e8315752ad8588c184da88f6f8817806728
treece6ff54308d742cd24ea2246cec72f037e99177f
parent4b30987ddcd67d7d1129c3fdadf978df185d2c3d
net/mlx5e: Always clear dest encap in neigh-update-del

[ Upstream commit 2951b2e142ecf6e0115df785ba91e91b6da74602 ]

The cited commit introduced a bug for multiple encapsulations flow.
If one dest encap becomes invalid, the flow is set slow path flag.
But when other dests encap become invalid, they are not cleared due
to slow path flag of the flow. When neigh-update-add is running, it
will use invalid encap.

Fix it by checking slow path flag after clearing dest encap.

Fixes: 9a5f9cc794e1 ("net/mlx5e: Fix possible use-after-free deleting fdb rule")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c