udp: call skb_orphan() before skb_attempt_defer_free()
Subsystems (3)
PATCH 1/1 udp: call skb_orphan() before skb_attempt_defer_free()
Standard UDP receive path does not use skb->destructor.
But skmsg layer does use it, since it calls skb_set_owner_sk_safe() from udp_read_skb().
This then triggers this warning in skb_attempt_defer_free():
DEBUG_NET_WARN_ON_ONCE(skb->destructor);
We must call skb_orphan() to fix this issue.
Fixes 6471658dc66c ("udp: use skb_attempt_defer_free()")
Reported-by [email protected]
Signed-off-by Eric Dumazet <[email protected]>
--- net/ipv4/udp.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/udp.c +1 -0
@@ -1851,6 +1851,7 @@ void skb_consume_udp(struct sock *sk, struct sk_buff *skb, int len)sk_peek_offset_bwd (sk, len);if (!skb_shared (skb)) { +skb_orphan (skb);skb_attempt_defer_free (skb);return ; }
Signature · 1 line
2.52.0.351.gbe84eed79e-goog
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Mon, 5 Jan 2026 09:36:30 +0000 you wrote:
Standard UDP receive path does not use
skb->destructor.But skmsg layer does use it, since it calls
skb_set_owner_sk_safe()fromudp_read_skb().This then triggers this warning in
skb_attempt_defer_free():[...]
Here is the summary with links:
- [net] udp: call skb_orphan() before skb_attempt_defer_free()
https://git.kernel.org/netdev/net/c/e5c8eda39a9f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html