netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] net: remove the bogus overflow debug check in pskb_may_pull()
@ 2024-06-06 22:15 Cong Wang
  2024-06-06 23:27 ` Florian Westphal
  0 siblings, 1 reply; 10+ messages in thread
From: Cong Wang @ 2024-06-06 22:15 UTC (permalink / raw)
  To: netdev; +Cc: bpf, Cong Wang, syzbot+0c4150bff9fff3bf023c, Florian Westphal

From: Cong Wang <cong.wang@bytedance.com>

Commit 219eee9c0d16 ("net: skbuff: add overflow debug check to pull/push
helpers") introduced an overflow debug check for pull/push helpers.
For __skb_pull() this makes sense because its callers rarely check its
return value. But for pskb_may_pull() it does not make sense, since its
return value is properly taken care of. Remove the one in
pskb_may_pull(), we can continue rely on its return value.

Fixes: 219eee9c0d16 ("net: skbuff: add overflow debug check to pull/push helpers")
Reported-by: syzbot+0c4150bff9fff3bf023c@syzkaller.appspotmail.com
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
---
 include/linux/skbuff.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 1c2902eaebd3..9fd49bab6595 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2735,8 +2735,6 @@ void *__pskb_pull_tail(struct sk_buff *skb, int delta);
 static inline enum skb_drop_reason
 pskb_may_pull_reason(struct sk_buff *skb, unsigned int len)
 {
-	DEBUG_NET_WARN_ON_ONCE(len > INT_MAX);
-
 	if (likely(len <= skb_headlen(skb)))
 		return SKB_NOT_DROPPED_YET;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-06-14 15:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 22:15 [Patch net] net: remove the bogus overflow debug check in pskb_may_pull() Cong Wang
2024-06-06 23:27 ` Florian Westphal
2024-06-07 16:14   ` Cong Wang
2024-06-07 21:32     ` Kuniyuki Iwashima
2024-06-08  8:01       ` Eric Dumazet
2024-06-08 22:24         ` Florian Westphal
2024-06-09  2:01         ` Jason Xing
2024-06-14 10:17         ` [PATCH bpf] bpf: avoid splat in pskb_pull_reason Florian Westphal
2024-06-14 12:11           ` Eric Dumazet
2024-06-14 15:30           ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).