Re: [PATCH net] netdevsim: drop PSP ext ref on forward failure

From: Daniel Zahka

Date: Tue Mar 17 2026 - 07:12:56 EST



On 3/17/26 02:14, Wesley Atwell wrote:
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: f857478d6206 ("netdevsim: a basic test PSP implementation")
Signed-off-by: Wesley Atwell <atwellwea@xxxxxxxxx>


Reviewed-by: Daniel Zahka <daniel.zahka@xxxxxxxxx>