linux-stable/drivers/net/ethernet/sfc
Zhipeng Lu 9f2e244bfc sfc: fix a double-free bug in efx_probe_filters
[ Upstream commit d5a306aedb ]

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: a9dc3d5612 ("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>
2024-01-10 17:16:50 +01:00
..
falcon sfc: allocate a big enough SKB for loopback selftest packet 2023-08-22 11:09:53 -07:00
siena - Some swap cleanups from Ma Wupeng ("fix WARN_ON in add_to_avail_list") 2023-08-29 14:25:26 -07:00
Kconfig sfc: add CONFIG_INET dependency for TC offload 2023-06-20 20:37:16 -07:00
Makefile sfc: functions to register for conntrack zone offload 2023-08-09 11:14:37 +01:00
bitfield.h sfc: offload left-hand side rules for conntrack 2023-08-09 11:14:38 +01:00
ef10.c sfc: Remove struct efx_special_buffer 2023-07-28 09:54:17 +01:00
ef10_regs.h
ef10_sriov.c
ef10_sriov.h sfc: Remove some NIC type indirections that are no longer needed 2023-07-28 09:54:17 +01:00
ef100.c sfc_ef100: Drop redundant pci_disable_pcie_error_reporting() 2023-03-08 23:34:39 -08:00
ef100.h
ef100_ethtool.c sfc: remove 'log-tc-errors' ethtool private flag 2022-10-19 13:00:05 -07:00
ef100_ethtool.h
ef100_netdev.c sfc: neighbour lookup for TC encap action offload 2023-06-10 00:11:49 -07:00
ef100_netdev.h
ef100_nic.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-18 12:44:56 -07:00
ef100_nic.h sfc: add support for devlink port_function_hw_addr_get in ef100 2023-02-16 12:03:13 +01:00
ef100_regs.h
ef100_rep.c sfc: add support for devlink port_function_hw_addr_get in ef100 2023-02-16 12:03:13 +01:00
ef100_rep.h sfc: add support for devlink port_function_hw_addr_get in ef100 2023-02-16 12:03:13 +01:00
ef100_rx.c sfc: add ability for extra channels to receive raw RX buffers 2022-11-16 09:07:02 +00:00
ef100_rx.h
ef100_sriov.c
ef100_sriov.h
ef100_tx.c sfc: Remove struct efx_special_buffer 2023-07-28 09:54:17 +01:00
ef100_tx.h sfc: use budget for TX completions 2023-06-17 00:06:55 -07:00
efx.c sfc: Remove support for siena high priority queue 2023-07-28 09:54:17 +01:00
efx.h sfc: Remove support for siena high priority queue 2023-07-28 09:54:17 +01:00
efx_channels.c sfc: Remove struct efx_special_buffer 2023-07-28 09:54:17 +01:00
efx_channels.h
efx_common.c sfc: Miscellaneous comment removals 2023-07-28 09:54:18 +01:00
efx_common.h
efx_devlink.c sfc: support for devlink port requires MAE access 2023-06-29 11:10:27 -07:00
efx_devlink.h sfc: add devlink port support for ef100 2023-02-16 12:03:12 +01:00
enum.h
ethtool.c
ethtool_common.c sfc: remove 'log-tc-errors' ethtool private flag 2022-10-19 13:00:05 -07:00
ethtool_common.h sfc: remove 'log-tc-errors' ethtool private flag 2022-10-19 13:00:05 -07:00
filter.h sfc: Miscellaneous comment removals 2023-07-28 09:54:18 +01:00
io.h - Some swap cleanups from Ma Wupeng ("fix WARN_ON in add_to_avail_list") 2023-08-29 14:25:26 -07:00
mae.c sfc: add decrement ttl by offloading set ipv4 ttl actions 2023-08-27 06:56:54 +01:00
mae.h sfc: introduce ethernet pedit set action infrastructure 2023-08-27 06:56:54 +01:00
mae_counter_format.h sfc: add extra RX channel to receive MAE counter updates on ef100 2022-11-16 09:07:02 +00:00
mcdi.c sfc: Remove some NIC type indirections that are no longer needed 2023-07-28 09:54:17 +01:00
mcdi.h sfc: offload left-hand side rules for conntrack 2023-08-09 11:14:38 +01:00
mcdi_filters.c
mcdi_filters.h
mcdi_functions.c sfc: Remove struct efx_special_buffer 2023-07-28 09:54:17 +01:00
mcdi_functions.h
mcdi_mon.c
mcdi_pcol.h
mcdi_pcol_mae.h
mcdi_port.c
mcdi_port.h
mcdi_port_common.c sfc: Filter cleanups for Falcon and Siena 2023-07-28 09:54:17 +01:00
mcdi_port_common.h
mtd.c
net_driver.h sfc: Remove struct efx_special_buffer 2023-07-28 09:54:17 +01:00
nic.c sfc: Cleanups in io.h 2023-07-28 09:54:18 +01:00
nic.h sfc: Remove siena_nic_data and stats 2023-07-28 09:54:17 +01:00
nic_common.h sfc: Miscellaneous comment removals 2023-07-28 09:54:18 +01:00
ptp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-29 07:44:56 +02:00
ptp.h
rx.c sfc: check for zero length in EF10 RX prefix 2023-09-01 08:14:57 +01:00
rx_common.c sfc: fix a double-free bug in efx_probe_filters 2024-01-10 17:16:50 +01:00
rx_common.h
selftest.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-24 10:51:39 -07:00
selftest.h
sriov.c
sriov.h
tc.c sfc: cleanup and reduce netlink error messages 2023-10-23 15:47:47 -07:00
tc.h sfc: add decrement ttl by offloading set ipv4 ttl actions 2023-08-27 06:56:54 +01:00
tc_bindings.c sfc: neighbour lookup for TC encap action offload 2023-06-10 00:11:49 -07:00
tc_bindings.h sfc: do not try to call tc functions when CONFIG_SFC_SRIOV=n 2023-06-16 09:12:18 +01:00
tc_conntrack.c sfc: handle error pointers returned by rhashtable_lookup_get_insert_fast() 2023-09-21 10:37:16 +02:00
tc_conntrack.h sfc: handle non-zero chain_index on TC rules 2023-08-09 11:14:38 +01:00
tc_counters.c sfc: handle error pointers returned by rhashtable_lookup_get_insert_fast() 2023-09-21 10:37:16 +02:00
tc_counters.h sfc: offload conntrack flow entries (match only) from CT zones 2023-08-09 11:14:38 +01:00
tc_encap_actions.c sfc: handle error pointers returned by rhashtable_lookup_get_insert_fast() 2023-09-21 10:37:16 +02:00
tc_encap_actions.h sfc: do not try to call tc functions when CONFIG_SFC_SRIOV=n 2023-06-16 09:12:18 +01:00
tx.c sfc: Remove support for siena high priority queue 2023-07-28 09:54:17 +01:00
tx.h
tx_common.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-22 18:40:38 -07:00
tx_common.h sfc: use budget for TX completions 2023-06-17 00:06:55 -07:00
tx_tso.c sfc: Remove struct efx_special_buffer 2023-07-28 09:54:17 +01:00
workarounds.h sfc: Remove EFX_REV_SIENA_A0 2023-07-28 09:54:17 +01:00