mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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: 5dbe906ff1 ("net/mlx5e: Use a slow path rule instead if vxlan neighbour isn't available")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
committed by
Saeed Mahameed
parent
8e7e2e8ed0
commit
9a5f9cc794
@@ -147,7 +147,7 @@ void mlx5e_tc_encap_flows_add(struct mlx5e_priv *priv,
|
|||||||
mlx5e_rep_queue_neigh_stats_work(priv);
|
mlx5e_rep_queue_neigh_stats_work(priv);
|
||||||
|
|
||||||
list_for_each_entry(flow, flow_list, tmp_list) {
|
list_for_each_entry(flow, flow_list, tmp_list) {
|
||||||
if (!mlx5e_is_offloaded_flow(flow))
|
if (!mlx5e_is_offloaded_flow(flow) || !flow_flag_test(flow, SLOW))
|
||||||
continue;
|
continue;
|
||||||
attr = flow->attr;
|
attr = flow->attr;
|
||||||
esw_attr = attr->esw_attr;
|
esw_attr = attr->esw_attr;
|
||||||
@@ -188,7 +188,7 @@ void mlx5e_tc_encap_flows_del(struct mlx5e_priv *priv,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
list_for_each_entry(flow, flow_list, tmp_list) {
|
list_for_each_entry(flow, flow_list, tmp_list) {
|
||||||
if (!mlx5e_is_offloaded_flow(flow))
|
if (!mlx5e_is_offloaded_flow(flow) || flow_flag_test(flow, SLOW))
|
||||||
continue;
|
continue;
|
||||||
attr = flow->attr;
|
attr = flow->attr;
|
||||||
esw_attr = attr->esw_attr;
|
esw_attr = attr->esw_attr;
|
||||||
|
|||||||
Reference in New Issue
Block a user