Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: "Steinar H. Gunderson" <sesse@google.com>,
	Florian Zumbiehl <florz@florz.de>,
	netdev <netdev@vger.kernel.org>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH] vlan: mask vlan prio bits
Date: Thu, 18 Jul 2013 08:49:30 -0700	[thread overview]
Message-ID: <1374162570.6097.33.camel@edumazet-glaptop> (raw)
In-Reply-To: <1374157166.6097.28.camel@edumazet-glaptop>

On Thu, 2013-07-18 at 07:19 -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> In commit 48cc32d38a52d0b68f91a171a8d00531edc6a46e
> ("vlan: don't deliver frames for unknown vlans to protocols")
> Florian made sure we set pkt_type to PACKET_OTHERHOST
> if the vlan id is set and we could find a vlan device for this
> particular id.
> 
> But we also have a problem if prio bits are set.
> 
> Steinar reported an issue on a router receiving IPv6 frames with a
> vlan tag of 4000 (id 0, prio 2), and tunneled into a sit device,
> because skb->vlan_tci is set.
> 
> Forwarded frame is completely corrupted : We can see (8100:4000)
> being inserted in the middle of IPv6 source address :
> 
> 16:48:00.780413 IP6 2001:16d8:8100:4000:ee1c:0:9d9:bc87 >
> 9f94:4d95:2001:67c:29f4::: ICMP6, unknown icmp6 type (0), length 64
>        0x0000:  0000 0029 8000 c7c3 7103 0001 a0ae e651
>        0x0010:  0000 0000 ccce 0b00 0000 0000 1011 1213
>        0x0020:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
>        0x0030:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
> 
> It seems we are not really ready to properly cope with this right now.
> 
> We can probably do better in future kernels : 
> vlan_get_ingress_priority() should be a netdev property instead of
> a per vlan_dev one.
> 
> For stable kernels, lets clear vlan_tci to fix the bugs.
> 
> Reported-by: Steinar H. Gunderson <sesse@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---

While looking at the 'future' patches for net-next, I found
that vlan_dev_get_egress_qos_mask() uses no protection at all
while doing the lookup in hash table.

This is racy with concurrent insert/deletes, eventually.

This probably needs a bit of RCU care ;)

  reply	other threads:[~2013-07-18 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 14:19 [PATCH] vlan: mask vlan prio bits Eric Dumazet
2013-07-18 15:49 ` Eric Dumazet [this message]
2013-07-18 16:35   ` [PATCH] vlan: fix a race in egress prio management Eric Dumazet
2013-07-18 20:07     ` David Miller
2013-07-18 20:05 ` [PATCH] vlan: mask vlan prio bits David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374162570.6097.33.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=florz@florz.de \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=sesse@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox