linux/drivers/net/netdevsim
Daniel Zahka 07bdec3fc7 netdevsim: psp: rcu protect psp_dev reference
There are two issues with the way psp_dev is used in nsim_do_psp():

1. There is no check for IS_ERR() on the peers psp_dev, before
   dereferencing.
2. The refcount on this psp_dev can be dropped by
   nsim_psp_rereg_write()

To fix this, we can make netdevsim's reference to its psp_dev an rcu
reference, and then nsim_do_psp() can read the fields it needs from an
rcu critical section.

Fixes: f857478d62 ("netdevsim: a basic test PSP implementation")
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260505-psd-rcu-v1-3-a8f69ec1ab96@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-06 17:39:20 -07:00
..
bpf.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bus.c net: netdevsim: correct typo in new_device_store error message 2026-03-20 20:12:01 -07:00
dev.c netdevsim: zero initialize struct iphdr in dummy sk_buff 2026-04-27 17:03:13 -07:00
ethtool.c ethtool: add FEC bins histogram report 2025-09-26 16:49:18 -07:00
fib.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
health.c devlink: Move graceful period parameter to reporter ops 2025-08-26 17:24:16 -07:00
hwstats.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ipsec.c netdevsim: add ipsec hw_features 2025-10-16 15:44:32 -07:00
macsec.c netdevsim: macsec: pad u64 to correct length in logs 2024-10-23 09:51:06 +02:00
Makefile netdevsim: move TC offload code to a dedicated file 2026-03-20 20:13:14 -07:00
netdev.c netdevsim: psp: only call nsim_psp_uninit() on PFs 2026-05-06 17:39:20 -07:00
netdevsim.h netdevsim: psp: rcu protect psp_dev reference 2026-05-06 17:39:20 -07:00
psample.c net: use get_random_u{16,32,64}() where appropriate 2026-04-09 19:27:43 -07:00
psp.c netdevsim: psp: rcu protect psp_dev reference 2026-05-06 17:39:20 -07:00
tc.c netdevsim: support tc-ets offload 2026-03-20 20:13:14 -07:00
udp_tunnels.c netdevsim: remove udp_ports_sleep 2025-06-18 18:53:51 -07:00