All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: reset mac header in dev_start_xmit()
@ 2013-02-06  6:22 Eric Dumazet
  2013-02-06  6:40 ` Ben Greear
  2013-02-06 20:59 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2013-02-06  6:22 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ben Greear

From: Eric Dumazet <edumazet@google.com>

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"

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ben Greear <greearb@candelatech.com>
---
 net/core/dev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index a87bc74..0b888b5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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.
 	 */

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

* Re: [PATCH net-next 1/2] net: reset mac header in dev_start_xmit()
  2013-02-06  6:22 [PATCH net-next 1/2] net: reset mac header in dev_start_xmit() Eric Dumazet
@ 2013-02-06  6:40 ` Ben Greear
  2013-02-06 20:59 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Greear @ 2013-02-06  6:40 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev

On 02/05/2013 10:22 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 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"

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

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

* Re: [PATCH net-next 1/2] net: reset mac header in dev_start_xmit()
  2013-02-06  6:22 [PATCH net-next 1/2] net: reset mac header in dev_start_xmit() Eric Dumazet
  2013-02-06  6:40 ` Ben Greear
@ 2013-02-06 20:59 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-02-06 20:59 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, greearb

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 05 Feb 2013 22:22:20 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> 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"
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.

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

end of thread, other threads:[~2013-02-06 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06  6:22 [PATCH net-next 1/2] net: reset mac header in dev_start_xmit() Eric Dumazet
2013-02-06  6:40 ` Ben Greear
2013-02-06 20:59 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.