Patch "net/mlx5e: fix double free in macsec_fs_tx_create_crypto_table_groups" has been added to the 6.4-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 double free in macsec_fs_tx_create_crypto_table_groups

to the 6.4-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-double-free-in-macsec_fs_tx_create_cry.patch
and it can be found in the queue-6.4 subdirectory.

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



commit 960f9c48f1657ecaf54ebde6292f5226a8bcb732
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Tue Jul 4 15:06:40 2023 +0800

    net/mlx5e: fix double free in macsec_fs_tx_create_crypto_table_groups
    
    [ Upstream commit aeb660171b0663847fa04806a96302ac6112ad26 ]
    
    In function macsec_fs_tx_create_crypto_table_groups(), when the ft->g
    memory is successfully allocated but the 'in' memory fails to be
    allocated, the memory pointed to by ft->g is released once. And in function
    macsec_fs_tx_create(), macsec_fs_tx_destroy() is called to release the
    memory pointed to by ft->g again. This will cause double free problem.
    
    Fixes: e467b283ffd5 ("net/mlx5e: Add MACsec TX steering rules")
    Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
    Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
index 7fc901a6ec5fc..414e285848813 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c
@@ -161,6 +161,7 @@ static int macsec_fs_tx_create_crypto_table_groups(struct mlx5e_flow_table *ft)
 
 	if (!in) {
 		kfree(ft->g);
+		ft->g = NULL;
 		return -ENOMEM;
 	}
 



[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