Patch "sfc: fix a double-free bug in efx_probe_filters" 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

    sfc: fix a double-free bug in efx_probe_filters

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:
     sfc-fix-a-double-free-bug-in-efx_probe_filters.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 8c1095d26a73f2833e1f8e43056a8371a254b8f5
Author: Zhipeng Lu <alexious@xxxxxxxxxx>
Date:   Mon Dec 25 19:29:14 2023 +0800

    sfc: fix a double-free bug in efx_probe_filters
    
    [ Upstream commit d5a306aedba34e640b11d7026dbbafb78ee3a5f6 ]
    
    In efx_probe_filters, the channel->rps_flow_id is freed in a
    efx_for_each_channel marco  when success equals to 0.
    However, after the following call chain:
    
    ef100_net_open
      |-> efx_probe_filters
      |-> ef100_net_stop
            |-> efx_remove_filters
    
    The channel->rps_flow_id is freed again in the efx_for_each_channel of
    efx_remove_filters, triggering a double-free bug.
    
    Fixes: a9dc3d5612ce ("sfc_ef100: RX filter table management and related gubbins")
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Reviewed-by: Edward Cree <ecree.xilinx@xxxxxxxxx>
    Signed-off-by: Zhipeng Lu <alexious@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231225112915.3544581-1-alexious@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/sfc/rx_common.c b/drivers/net/ethernet/sfc/rx_common.c
index 9220afeddee81..3f290791df1c4 100644
--- a/drivers/net/ethernet/sfc/rx_common.c
+++ b/drivers/net/ethernet/sfc/rx_common.c
@@ -820,8 +820,10 @@ int efx_probe_filters(struct efx_nic *efx)
 		}
 
 		if (!success) {
-			efx_for_each_channel(channel, efx)
+			efx_for_each_channel(channel, efx) {
 				kfree(channel->rps_flow_id);
+				channel->rps_flow_id = NULL;
+			}
 			efx->type->filter_table_remove(efx);
 			rc = -ENOMEM;
 			goto out_unlock;




[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