Commit dc9fd14b authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

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);

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260130160253.2936789-1-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 87ef8c26
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
}