Patch "net: bnxt: fix a potential use-after-free in bnxt_init_tc" has been added to the 6.1-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: bnxt: fix a potential use-after-free in bnxt_init_tc

to the 6.1-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-bnxt-fix-a-potential-use-after-free-in-bnxt_init.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 44d885c7382dbbd7527834bed81f03493b0d85ab
Author: Dinghao Liu <dinghao.liu@xxxxxxxxxx>
Date:   Mon Dec 4 10:40:04 2023 +0800

    net: bnxt: fix a potential use-after-free in bnxt_init_tc
    
    [ Upstream commit d007caaaf052f82ca2340d4c7b32d04a3f5dbf3f ]
    
    When flow_indr_dev_register() fails, bnxt_init_tc will free
    bp->tc_info through kfree(). However, the caller function
    bnxt_init_one() will ignore this failure and call
    bnxt_shutdown_tc() on failure of bnxt_dl_register(), where
    a use-after-free happens. Fix this issue by setting
    bp->tc_info to NULL after kfree().
    
    Fixes: 627c89d00fb9 ("bnxt_en: flow_offload: offload tunnel decap rules via indirect callbacks")
    Signed-off-by: Dinghao Liu <dinghao.liu@xxxxxxxxxx>
    Reviewed-by: Pavan Chebbi <pavan.chebbi@xxxxxxxxxxxx>
    Reviewed-by: Michael Chan <michael.chan@xxxxxxxxxxxx>
    Reviewed-by: Somnath Kotur <somnath.kotur@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231204024004.8245-1-dinghao.liu@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
index d8afcf8d6b30e..4d6663ff84722 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
@@ -2075,6 +2075,7 @@ int bnxt_init_tc(struct bnxt *bp)
 	rhashtable_destroy(&tc_info->flow_table);
 free_tc_info:
 	kfree(tc_info);
+	bp->tc_info = NULL;
 	return rc;
 }
 




[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