]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sfc: fix a double-free bug in efx_probe_filters
authorZhipeng Lu <alexious@zju.edu.cn>
Mon, 25 Dec 2023 11:29:14 +0000 (19:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jan 2024 17:48:04 +0000 (18:48 +0100)
commitd1eb795385e182bbd126d096a2ce01d94acb279a
tree143dba9fb669174d2873b5895fa2e3b1da0213e3
parentcb69cad457fa9755bb27f6044e46acf2f3358ed9
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@kernel.org>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Link: https://lore.kernel.org/r/20231225112915.3544581-1-alexious@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sfc/rx_common.c