netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: dev_queue_xmit_nit fixes
@ 2013-01-08 18:51 Daniel Borkmann
  2013-01-08 18:51 ` [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value Daniel Borkmann
  2013-01-08 18:51 ` [PATCH net 2/2] net: dev_queue_xmit_nit: fix potential NULL ptr dereference Daniel Borkmann
  0 siblings, 2 replies; 18+ messages in thread
From: Daniel Borkmann @ 2013-01-08 18:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Daniel Borkmann

First patch is a fix for the netdev discussion ``PROBLEM: Software injected
vlan tagged packets are unable to be identified using recent BPF
modifications'' and the second one I spotted while doing the first fix.

Daniel Borkmann (2):
  net: dev_queue_xmit_nit: fix skb->vlan_tci field value
  net: dev_queue_xmit_nit: fix potential NULL ptr dereference

 net/core/dev.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value
@ 2013-01-09  5:15 Paul Pearce
  2013-01-09  6:06 ` Ani Sinha
  0 siblings, 1 reply; 18+ messages in thread
From: Paul Pearce @ 2013-01-09  5:15 UTC (permalink / raw)
  To: netdev; +Cc: dborkman, edumazet, Ani Sinha, jpirko

On Tue, 2013-01-08 at 19:51 +0100, Daniel Borkmann wrote:
> VLAN packets that are locally injected through taps will loose their
> skb->vlan_tci value when they pass dev_hard_start_xmit and get looped
> back to a packet sniffer via dev_queue_xmit_nit. Besides others, this
> meta data is used in Linux socket filtering for VLANs. Tested with a
> VLAN ancillary ops filter.
>
> Patch is based on a previous version by Jiri Pirko.

I think there may be issues with the patch beyond Eric's comments. It
seems to trash packet contents.

I applied this patch to Fedora flavored kernel 3.6.11-1.fc16.x86_64.
vlan tagged packets injected via libpcap's pcap_inject() came out
mangled at the packet filters.

The following injected packet:

01:01:01:01:01:01 > 02:02:02:02:02:02, ethertype 802.1Q (0x8100),
length 64: vlan 99, p 0, ethertype ARP, Request who-has 192.168.0.1
tell 192.168.0.1, length 46
0x0000:  0202 0202 0202 0101 0101 0101 8100 0063
0x0010:  0806 0001 0800 0604 0001 0025 6438 8afc
0x0020:  c0a8 0001 0000 0000 0000 c0a8 0001 0000
0x0030:  0000 0000 0000 0000 0000 0000 0000 0000

Arrived as this:

01:01:81:00:00:63 > 02:02:01:01:01:01, ethertype 802.1Q (0x8100),
length 64: vlan 514, p 0, ethertype ARP, Request who-has 192.168.0.1
tell 192.168.0.1, length 46
0x0000:  0202 0101 0101 0101 8100 0063 8100 0202
0x0010:  0806 0001 0800 0604 0001 0025 6438 8afc
0x0020:  c0a8 0001 0000 0000 0000 c0a8 0001 0000
0x0030:  0000 0000 0000 0000 0000 0000 0000 0000

It also might be worth noting the modified libpcap is able to identify
this packet with the filter "vlan" or "vlan 514". Prior to this kernel
patch such a packet could not be identified with any vlan filter.

If this isn't a problem with the patch, perhaps I'm missing a
necessary post-3.6.11 patch?

Thoughts?

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

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

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08 18:51 [PATCH net 0/2] net: dev_queue_xmit_nit fixes Daniel Borkmann
2013-01-08 18:51 ` [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value Daniel Borkmann
2013-01-08 19:54   ` Ani Sinha
2013-01-08 20:04   ` Eric Dumazet
2013-01-08 20:22     ` Jiri Pirko
2013-01-08 20:42       ` Eric Dumazet
2013-01-08 20:14   ` Jiri Pirko
2013-01-08 18:51 ` [PATCH net 2/2] net: dev_queue_xmit_nit: fix potential NULL ptr dereference Daniel Borkmann
2013-01-08 19:22   ` Eric Dumazet
2013-01-08 19:38     ` Daniel Borkmann
  -- strict thread matches above, loose matches on Subject: below --
2013-01-09  5:15 [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value Paul Pearce
2013-01-09  6:06 ` Ani Sinha
2013-01-09  6:27   ` Eric Dumazet
2013-01-09  6:34     ` Ani Sinha
2013-01-09 19:27       ` Ani Sinha
2013-01-09 19:51         ` Eric Dumazet
2013-01-09 20:01           ` Ani Sinha
2013-01-09 20:06             ` Ani Sinha

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).