lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Dec 2020 16:48:40 +0800
From:   Dinghao Liu <>
Cc:     Saeed Mahameed <>,
        Leon Romanovsky <>,
        "David S. Miller" <>,
        Jakub Kicinski <>,
        Or Gerlitz <>,
        Gal Pressman <>,
        Maor Gottlieb <>,,,
Subject: [PATCH] [v2] net/mlx5e: Fix two double free cases

mlx5e_create_ttc_table_groups() frees ft->g on failure of
kvzalloc(), but such failure will be caught by its caller
in mlx5e_create_ttc_table() and ft->g will be freed again
in mlx5e_destroy_flow_table(). The same issue also occurs
in mlx5e_create_ttc_table_groups(). Set ft->g to NULL after
kfree() to avoid double free.

Fixes: 7b3722fa9ef64 ("net/mlx5e: Support RSS for GRE tunneled packets")
Fixes: 33cfaaa8f36ff ("net/mlx5e: Split the main flow steering table")
Signed-off-by: Dinghao Liu <>


v2: - Set ft->g to NULL after kfree() instead of removing kfree().
      Refine commit message.
 drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index fa8149f6eb08..44a2dfbc3853 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -942,6 +942,7 @@ static int mlx5e_create_ttc_table_groups(struct mlx5e_ttc_table *ttc,
 	in = kvzalloc(inlen, GFP_KERNEL);
 	if (!in) {
+		ft->g = NULL;
 		return -ENOMEM;
@@ -1087,6 +1088,7 @@ static int mlx5e_create_inner_ttc_table_groups(struct mlx5e_ttc_table *ttc)
 	in = kvzalloc(inlen, GFP_KERNEL);
 	if (!in) {
+		ft->g = NULL;
 		return -ENOMEM;

Powered by blists - more mailing lists