Skip to content

Commit 0bed820

Browse files
author
Mohammad Kabat
committed
net/mlx5e: Fix use-after-free when reverting termination table
Bugzilla: https://bugzilla.redhat.com/2112947 Upstream-status: v6.1-rc8 commit 52c795a Author: Roi Dayan <roid@nvidia.com> Date: Mon Nov 14 20:04:29 2022 +0200 net/mlx5e: Fix use-after-free when reverting termination table 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: 10caabd ("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: Mohammad Kabat <mkabat@redhat.com>
1 parent 4c2319a commit 0bed820

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw,
312312
for (curr_dest = 0; curr_dest < num_vport_dests; curr_dest++) {
313313
struct mlx5_termtbl_handle *tt = attr->dests[curr_dest].termtbl;
314314

315+
attr->dests[curr_dest].termtbl = NULL;
316+
315317
/* search for the destination associated with the
316318
* current term table
317319
*/

0 commit comments

Comments
 (0)