Skip to contentSkip to conversation

skbuff: replace a BUG_ON() with the new DEBUG_NET_WARN_ON_ONCE()

PATCH Applied Jakub Kicinski 3 participants 3 messages May 11, 2022 – May 12, 2022

Subsystems (2)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 skbuff: replace a BUG_ON() with the new DEBUG_NET_WARN_ON_ONCE()

Very few drivers actually have Kconfig knobs for adding -DDEBUG. 8 according to a quick grep, while there are 93 users of skb_checksum_none_assert(). Switch to the new DEBUG_NET_WARN_ON_ONCE() to catch bad skbs.

---
CC: [email protected]

---
 include/linux/skbuff.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/skbuff.h +1 -3
index b91d225fdc13..9d82a8b6c8f1 100644
@@ -5048,9 +5048,7 @@ static inline void skb_forward_csum(struct sk_buff *skb)
  */
 static inline void skb_checksum_none_assert(const struct sk_buff *skb)
 {
-#ifdef DEBUG
-	BUG_ON(skb->ip_summed != CHECKSUM_NONE);
-#endif
+	DEBUG_NET_WARN_ON_ONCE(skb->ip_summed != CHECKSUM_NONE);
 }
 
 bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
Signature · 1 line
2.34.3
#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 11 May 2022 10:23:05 -0700 you wrote:

Very few drivers actually have Kconfig knobs for adding -DDEBUG. 8 according to a quick grep, while there are 93 users of skb_checksum_none_assert(). Switch to the new DEBUG_NET_WARN_ON_ONCE() to catch bad skbs.

[...]

Here is the summary with links:
- [net-next] skbuff: replace a BUG_ON() with the new DEBUG_NET_WARN_ON_ONCE()

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

You are awesome, thank you!

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