Skip to contentSkip to conversation

net: add a debug check in __skb_push()

PATCH Applied Eric Dumazet 2 participants 2 messages Jan 30 – Feb 3

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: add a debug check in __skb_push()

Add the following check, to detect bugs sooner for CONFIG_DEBUG_NET=y builds.

	DEBUG_NET_WARN_ON_ONCE(skb->data < skb->head);
---
 include/linux/skbuff.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/skbuff.h +1 -0
index e6bfe5d0c5252b2e7540e1fef9317aab83feced2..8b399ddf1b9bd0dddb37f417ccfa5ea675efafa3 100644
@@ -2813,6 +2813,7 @@ static inline void *__skb_push(struct sk_buff *skb, unsigned int len)
 	DEBUG_NET_WARN_ON_ONCE(len > INT_MAX);
 
 	skb->data -= len;
+	DEBUG_NET_WARN_ON_ONCE(skb->data < skb->head);
 	skb->len  += len;
 	return skb->data;
 }
Signature · 1 line
2.53.0.rc1.225.gd81095ad13-goog
#1 lore raw
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 Fri, 30 Jan 2026 16:02:53 +0000 you wrote:

Add the following check, to detect bugs sooner for CONFIG_DEBUG_NET=y builds.

	DEBUG_NET_WARN_ON_ONCE(skb->data < skb->head);

[...]

Here is the summary with links:
- [net-next] net: add a debug check in __skb_push()

    https://git.kernel.org/netdev/net-next/c/dc9fd14bd759

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html