Skip to contentSkip to conversation

net: reset mac header in dev_start_xmit()

PATCH Applied Eric Dumazet 3 participants 3 messages Feb 6, 2013

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

PATCH 1/2 net: reset mac header in dev_start_xmit()

From: Eric Dumazet <[email protected]>

On 64 bit arches :

There is a off-by-one error in qdisc_pkt_len_init() because mac_header is not set in xmit path.

skb_mac_header() returns an out of bound value that was harmless because hdr_len is an 'unsigned int'

On 32bit arches, the error is abysmal.

This patch is also a prereq for "macvlan: add multicast filter"

---
 net/core/dev.c |    2 ++
 1 file changed, 2 insertions(+)
net/core/dev.c +2 -0
index a87bc74..0b888b5 100644
@@ -2799,6 +2799,8 @@ int dev_queue_xmit(struct sk_buff *skb)
 	struct Qdisc *q;
 	int rc = -ENOMEM;
 
+	skb_reset_mac_header(skb);
+
 	/* Disable soft irqs for various locks below. Also
 	 * stops preemption for RCU.
 	 */
#1 lore raw
Quoted 7 lines · Eric Dumazet

From: Eric Dumazet <[email protected]>

On 64 bit arches :

There is a off-by-one error in qdisc_pkt_len_init() because mac_header is not set in xmit path.

Quoted 6 lines

skb_mac_header() returns an out of bound value that was harmless because hdr_len is an 'unsigned int'

On 32bit arches, the error is abysmal.

This patch is also a prereq for "macvlan: add multicast filter"

I'll go ahead and apply this one to our tree for testing, and will apply the multicast one as soon as I resolve some bugs that currently have me swamped...

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
maintainer Applied
#2 lore raw
In reply to Eric Dumazet

From: Eric Dumazet <[email protected]>
Date: Tue, 05 Feb 2013 22:22:20 -0800

Quoted 7 lines

From: Eric Dumazet <[email protected]>

On 64 bit arches :

There is a off-by-one error in qdisc_pkt_len_init() because mac_header is not set in xmit path.

Quoted 8 lines

skb_mac_header() returns an out of bound value that was harmless because hdr_len is an 'unsigned int'

On 32bit arches, the error is abysmal.

This patch is also a prereq for "macvlan: add multicast filter"

Applied.