net/mlx5e: Fix use-after-free when reverting termination table
[ Upstream commit52c795af04] 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:10caabdaad("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>
This commit is contained in:
parent
2cb84ff349
commit
0d2f9d95d9
1 changed files with 2 additions and 0 deletions
|
|
@ -308,6 +308,8 @@ revert_changes:
|
||||||
for (curr_dest = 0; curr_dest < num_vport_dests; curr_dest++) {
|
for (curr_dest = 0; curr_dest < num_vport_dests; curr_dest++) {
|
||||||
struct mlx5_termtbl_handle *tt = attr->dests[curr_dest].termtbl;
|
struct mlx5_termtbl_handle *tt = attr->dests[curr_dest].termtbl;
|
||||||
|
|
||||||
|
attr->dests[curr_dest].termtbl = NULL;
|
||||||
|
|
||||||
/* search for the destination associated with the
|
/* search for the destination associated with the
|
||||||
* current term table
|
* current term table
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue