linux/drivers/net/ethernet/sfc
Sebastian Andrzej Siewior 55e802468e sfc: Don't invoke xdp_do_flush() from netpoll.
Yury reported a crash in the sfc driver originated from
netpoll_send_udp(). The netconsole sends a message and then netpoll
invokes the driver's NAPI function with a budget of zero. It is
dedicated to allow driver to free TX resources, that it may have used
while sending the packet.

In the netpoll case the driver invokes xdp_do_flush() unconditionally,
leading to crash because bpf_net_context was never assigned.

Invoke xdp_do_flush() only if budget is not zero.

Fixes: 401cb7dae8 ("net: Reference bpf_redirect_info via task_struct on PREEMPT_RT.")
Reported-by: Yury Vostrikov <mon@unformed.ru>
Closes: https://lore.kernel.org/5627f6d1-5491-4462-9d75-bc0612c26a22@app.fastmail.com
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20241002125837.utOcRo6Y@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-10-03 15:42:00 -07:00
..
falcon Merge branch 'net-make-timestamping-selectable' 2024-07-15 08:02:30 -07:00
siena sfc: Don't invoke xdp_do_flush() from netpoll. 2024-10-03 15:42:00 -07:00
bitfield.h sfc: offload left-hand side rules for conntrack 2023-08-09 11:14:38 +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
ef10.c sfc: Add X4 PF support 2024-09-11 16:02:21 -07:00
ef100_ethtool.c ethtool: rss: don't report key if device doesn't support it 2024-08-12 14:16:24 +01: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
ef100_regs.h
ef100_rep.c netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-09-03 11:36:43 +02:00
ef100_rep.h
ef100_rx.c
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
ef100.c
ef100.h
efx_channels.c sfc: Don't invoke xdp_do_flush() from netpoll. 2024-10-03 15:42:00 -07:00
efx_channels.h
efx_common.c sfc: use new rxfh_context API 2024-06-28 18:53:21 -07: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
efx.c sfc: Add X4 PF support 2024-09-11 16:02:21 -07:00
efx.h sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
enum.h
ethtool_common.c sfc: remove get_rxfh_context dead code 2024-06-28 18:53:21 -07:00
ethtool_common.h sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
ethtool.c sfc: Remove setting of RX software timestamp 2024-09-09 17:44:41 -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
Kconfig sfc: add CONFIG_INET dependency for TC offload 2023-06-20 20:37:16 -07:00
mae_counter_format.h
mae.c sfc: support offloading ct(nat) action in RHS rules 2023-10-15 14:25:03 +01:00
mae.h sfc: introduce ethernet pedit set action infrastructure 2023-08-27 06:56:54 +01:00
Makefile sfc: functions to register for conntrack zone offload 2023-08-09 11:14:37 +01:00
mcdi_filters.c sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
mcdi_filters.h sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
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_mae.h
mcdi_pcol.h
mcdi_port_common.c sfc: Filter cleanups for Falcon and Siena 2023-07-28 09:54:17 +01:00
mcdi_port_common.h
mcdi_port.c
mcdi_port.h
mcdi.c sfc: replace deprecated strncpy with strscpy 2023-10-13 17:24:39 -07:00
mcdi.h sfc: offload left-hand side rules for conntrack 2023-08-09 11:14:38 +01:00
mtd.c
net_driver.h sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
nic_common.h sfc: Add X4 PF support 2024-09-11 16:02:21 -07:00
nic.c sfc: Cleanups in io.h 2023-07-28 09:54:18 +01:00
nic.h sfc: Add X4 PF support 2024-09-11 16:02:21 -07:00
ptp.c sfc: convert comma to semicolon 2024-09-06 18:06:40 -07:00
ptp.h net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
rx_common.c sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
rx_common.h sfc: use new rxfh_context API 2024-06-28 18:53:21 -07:00
rx.c sfc: check for zero length in EF10 RX prefix 2023-09-01 08:14:57 +01:00
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_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: parse mangle actions (NAT) in conntrack entries 2023-10-15 14:25:03 +01: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: Convert to use ERR_CAST() 2024-08-30 11:10:02 -07: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
tc.c sfc: use flow_rule_is_supp_enc_control_flags() 2024-06-12 17:56:00 -07:00
tc.h sfc: support offloading ct(nat) action in RHS rules 2023-10-15 14:25:03 +01:00
tx_common.c net: adopt skb_network_offset() and similar helpers 2024-03-04 08:47:06 +00:00
tx_common.h sfc: use budget for TX completions 2023-06-17 00:06:55 -07:00
tx_tso.c net: adopt skb_network_offset() and similar helpers 2024-03-04 08:47:06 +00:00
tx.c sfc: Remove support for siena high priority queue 2023-07-28 09:54:17 +01:00
tx.h
workarounds.h sfc: Remove EFX_REV_SIENA_A0 2023-07-28 09:54:17 +01:00