mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
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: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260130160253.2936789-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
87ef8c26ae
commit
dc9fd14bd7
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user