linux/drivers/net/netdevsim
Wesley Atwell 7d9351435e netdevsim: drop PSP ext ref on forward failure
nsim_do_psp() takes an extra reference to the PSP skb extension so the
extension survives __dev_forward_skb(). That forward path scrubs the skb
and drops attached skb extensions before nsim_psp_handle_ext() can
reattach the PSP metadata.

If __dev_forward_skb() fails in nsim_forward_skb(), the function returns
before nsim_psp_handle_ext() can attach that extension to the skb, leaving
the extra reference leaked.

Drop the saved PSP extension reference before returning from the
forward-failure path. Guard the put because plain or non-decapsulated
traffic can also fail forwarding without ever taking the extra PSP
reference.

Fixes: f857478d62 ("netdevsim: a basic test PSP implementation")
Signed-off-by: Wesley Atwell <atwellwea@gmail.com>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20260317061431.1482716-1-atwellwea@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-03-18 17:13:34 -07:00
..
Makefile netdevsim: a basic test PSP implementation 2025-09-30 15:17:21 +02: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 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dev.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08: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
netdev.c netdevsim: drop PSP ext ref on forward failure 2026-03-18 17:13:34 -07:00
netdevsim.h netdevsim: use u64_stats_t with u64_stats_sync properly 2026-01-26 19:53:36 -08:00
psample.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
psp.c netdevsim: use u64_stats_t with u64_stats_sync properly 2026-01-26 19:53:36 -08:00
udp_tunnels.c netdevsim: remove udp_ports_sleep 2025-06-18 18:53:51 -07:00