Skip to contentSkip to conversation

"protocol 0300 is buggy" spam in dmesg when injecting&capturing on same interface

DISCUSSION Pekka Pietikainen 1 participant 2 messages Feb 18, 2008 – Feb 19, 2008

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

When playing with some L2 level fuzzing I started getting lots of "protocol 0300 is buggy, dev eth3" spew in dmesg. That interface is also capturing the traffic that's being sent, that's probably why the dev_queue_xmit_nit codepath is getting called in the first place.

Tested on 2.6.23-as-shipped-in-F8. didn't spot any relevant changes in .24 but can pretty easily verify there too.

Oh. That printk wasn't very easy to find:

if (net_ratelimit())
printk(KERN_CRIT "protocol %04x is "
"buggy, dev %s\n",

and I naturally grepped for "is buggy".

Any ideas? Add a "If it came from AF_PACKET, don't print out anything" to that if-statement?

#1 lore raw
Quoted 7 lines · Pekka Pietikainen

When playing with some L2 level fuzzing I started getting lots of "protocol 0300 is buggy, dev eth3" spew in dmesg. That interface is also capturing the traffic that's being sent, that's probably why the dev_queue_xmit_nit codepath is getting called in the first place.

Any ideas? Add a "If it came from AF_PACKET, don't print out anything" to that if-statement?

I'm probably just plastering over a bug in af_packet.c with this one, but the following patch should make it shut up. The printk definately needs a ntohs for skb2->protocol, took me a while to figure out where the 0300 even came from :-)

net/core/dev.c renamed from net/core/dev.c.orig +5 -4
diff -up linux-2.6.24.i686/net/core/dev.c.orig linux-2.6.24.i686/net/core/dev.c
@@ -1262,10 +1262,11 @@ static void dev_queue_xmit_nit(struct sk
 
 			if (skb_network_header(skb2) < skb2->data ||
 			    skb2->network_header > skb2->tail) {
-				if (net_ratelimit())
-					printk(KERN_CRIT "protocol %04x is "
-					       "buggy, dev %s\n",
-					       skb2->protocol, dev->name);
+				if (skb2->protocol != htons(ETH_P_ALL) &&
+				    net_ratelimit())
+					pr_crit("protocol %04x is buggy, dev %s\n",
+						ntohs(skb2->protocol),
+						dev->name);
 				skb_reset_network_header(skb2);
 			}
 
Signature · 1 line
Pekka Pietikainen