]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: clear skb->sk in skb_release_head_state()
authorEric Dumazet <edumazet@google.com>
Tue, 11 Nov 2025 15:12:35 +0000 (15:12 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Nov 2025 14:48:33 +0000 (06:48 -0800)
skb_release_head_state() inlines skb_orphan().

We need to clear skb->sk otherwise we can freeze TCP flows
on a mostly idle host, because skb_fclone_busy() would
return true as long as the packet is not yet processed by
skb_defer_free_flush().

Fixes: 1fcf572211da ("net: allow skb_release_head_state() to be called multiple times")
Fixes: e20dfbad8aab ("net: fix napi_consume_skb() with alien skbs")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Aditya Garg <gargaditya@linux.microsoft.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20251111151235.1903659-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c

index 4f4d7ab7057f16bcf88f29827a45a9f4a8f43d5c..f34372666e67cee5329d3ba1d3c86f8622facac3 100644 (file)
@@ -1152,6 +1152,7 @@ void skb_release_head_state(struct sk_buff *skb)
 
 #endif
                skb->destructor = NULL;
+               skb->sk = NULL;
        }
        nf_reset_ct(skb);
        skb_ext_reset(skb);