提交 788f920a 编写于 作者: E Edward Cree 提交者: David S. Miller

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: a9dc3d56 ("sfc_ef100: RX filter table management and related gubbins")
Signed-off-by: NEdward Cree <ecree@solarflare.com>
Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9cbbc451
...@@ -849,6 +849,7 @@ void efx_remove_filters(struct efx_nic *efx) ...@@ -849,6 +849,7 @@ void efx_remove_filters(struct efx_nic *efx)
efx_for_each_channel(channel, efx) { efx_for_each_channel(channel, efx) {
cancel_delayed_work_sync(&channel->filter_work); cancel_delayed_work_sync(&channel->filter_work);
kfree(channel->rps_flow_id); kfree(channel->rps_flow_id);
channel->rps_flow_id = NULL;
} }
#endif #endif
down_write(&efx->filter_sem); down_write(&efx->filter_sem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册