Skip to content

Commit 788f920

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: null out channel->rps_flow_id after freeing it
If an ef100_net_open() fails, ef100_net_stop() may be called without channel->rps_flow_id having been written; thus it may hold the address freed by a previous ef100_net_stop()'s call to efx_remove_filters(). This then causes a double-free when efx_remove_filters() is called again, leading to a panic. To prevent this, after freeing it, overwrite it with NULL. Fixes: a9dc3d5 ("sfc_ef100: RX filter table management and related gubbins") Signed-off-by: Edward Cree <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9cbbc45 commit 788f920

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/sfc/rx_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ void efx_remove_filters(struct efx_nic *efx)
849849
efx_for_each_channel(channel, efx) {
850850
cancel_delayed_work_sync(&channel->filter_work);
851851
kfree(channel->rps_flow_id);
852+
channel->rps_flow_id = NULL;
852853
}
853854
#endif
854855
down_write(&efx->filter_sem);

0 commit comments

Comments
 (0)