Skip to content

Commit d5a306a

Browse files
AlexiousLukuba-moo
authored andcommitted
sfc: fix a double-free bug in efx_probe_filters
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: a9dc3d5 ("sfc_ef100: RX filter table management and related gubbins") Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Edward Cree <[email protected]> Signed-off-by: Zhipeng Lu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8cdafdd commit d5a306a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/sfc/rx_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,10 @@ int efx_probe_filters(struct efx_nic *efx)
823823
}
824824

825825
if (!success) {
826-
efx_for_each_channel(channel, efx)
826+
efx_for_each_channel(channel, efx) {
827827
kfree(channel->rps_flow_id);
828+
channel->rps_flow_id = NULL;
829+
}
828830
efx->type->filter_table_remove(efx);
829831
rc = -ENOMEM;
830832
goto out_unlock;

0 commit comments

Comments
 (0)