Skip to content

Commit 9a5f9cc

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: Fix possible use-after-free deleting fdb rule
After neigh-update-add failure we are still with a slow path rule but the driver always assume the rule is an fdb rule. Fix neigh-update-del by checking slow path tc flag on the flow. Also fix neigh-update-add for when neigh-update-del fails the same. Fixes: 5dbe906 ("net/mlx5e: Use a slow path rule instead if vxlan neighbour isn't available") Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Paul Blakey <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8e7e2e8 commit 9a5f9cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void mlx5e_tc_encap_flows_add(struct mlx5e_priv *priv,
147147
mlx5e_rep_queue_neigh_stats_work(priv);
148148

149149
list_for_each_entry(flow, flow_list, tmp_list) {
150-
if (!mlx5e_is_offloaded_flow(flow))
150+
if (!mlx5e_is_offloaded_flow(flow) || !flow_flag_test(flow, SLOW))
151151
continue;
152152
attr = flow->attr;
153153
esw_attr = attr->esw_attr;
@@ -188,7 +188,7 @@ void mlx5e_tc_encap_flows_del(struct mlx5e_priv *priv,
188188
int err;
189189

190190
list_for_each_entry(flow, flow_list, tmp_list) {
191-
if (!mlx5e_is_offloaded_flow(flow))
191+
if (!mlx5e_is_offloaded_flow(flow) || flow_flag_test(flow, SLOW))
192192
continue;
193193
attr = flow->attr;
194194
esw_attr = attr->esw_attr;

0 commit comments

Comments
 (0)