net: clear skb->sk in skb_release_head_state()
Subsystems (2)
PATCH 1/1 net: clear skb->sk in skb_release_head_state()
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().
--- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+)
net/core/skbuff.c +1 -0
@@ -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);
Signature · 1 line
2.52.0.rc1.455.g30608eb744-goog
Quoted 29 lines · Eric Dumazet
skb_release_head_state()inlinesskb_orphan().We need to clear
skb->skotherwise we can freeze TCP flows on a mostly idle host, becauseskb_fclone_busy()would return true as long as the packet is not yet processed byskb_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 <[email protected]>--- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+)net/core/skbuff.c +1
-0@@ -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);Signature · 1 line
2.52.0.rc1.455.g30608eb744-goog
Quoted 11 lines · Eric Dumazet
skb_release_head_state()inlinesskb_orphan().We need to clear
skb->skotherwise we can freeze TCP flows on a mostly idle host, becauseskb_fclone_busy()would return true as long as the packet is not yet processed byskb_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 <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 11 Nov 2025 15:12:35 +0000 you wrote:
skb_release_head_state()inlinesskb_orphan().We need to clear
skb->skotherwise we can freeze TCP flows on a mostly idle host, becauseskb_fclone_busy()would return true as long as the packet is not yet processed byskb_defer_free_flush().[...]
Here is the summary with links:
- [net-next] net: clear skb->sk in skb_release_head_state()
https://git.kernel.org/netdev/net-next/c/26b8986a18c1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html