Patch "net/mlx5e: Fix use-after-free when reverting termination table" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net/mlx5e: Fix use-after-free when reverting termination table

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mlx5e-fix-use-after-free-when-reverting-terminat.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 63aef6f3117b1391c4848ff3bb6ce644755a09b2
Author: Roi Dayan <roid@xxxxxxxxxx>
Date:   Mon Nov 14 20:04:29 2022 +0200

    net/mlx5e: Fix use-after-free when reverting termination table
    
    [ Upstream commit 52c795af04441d76f565c4634f893e5b553df2ae ]
    
    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: 10caabdaad5a ("net/mlx5e: Use termination table for VLAN push actions")
    Signed-off-by: Roi Dayan <roid@xxxxxxxxxx>
    Reviewed-by: Maor Dickman <maord@xxxxxxxxxx>
    Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
index 8f86b62e49e3..1b417b1d1cf8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
@@ -309,6 +309,8 @@ mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw,
 	for (curr_dest = 0; curr_dest < num_vport_dests; curr_dest++) {
 		struct mlx5_termtbl_handle *tt = attr->dests[curr_dest].termtbl;
 
+		attr->dests[curr_dest].termtbl = NULL;
+
 		/* search for the destination associated with the
 		 * current term table
 		 */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux