Toshiaki Makita
01a68a265e
net: Fix vlan untag for bridge and vlan_dev with reorder_hdr off
...
[ Upstream commit 4bbb3e0e8239f9079bf1fe20b3c0cb598714ae61 ]
When we have a bridge with vlan_filtering on and a vlan device on top of
it, packets would be corrupted in skb_vlan_untag() called from
br_dev_xmit().
The problem sits in skb_reorder_vlan_header() used in skb_vlan_untag(),
which makes use of skb->mac_len. In this function mac_len is meant for
handling rx path with vlan devices with reorder_header disabled, but in
tx path mac_len is typically 0 and cannot be used, which is the problem
in this case.
The current code even does not properly handle rx path (skb_vlan_untag()
called from __netif_receive_skb_core()) with reorder_header off actually.
In rx path single tag case, it works as follows:
- Before skb_reorder_vlan_header()
mac_header data
v v
+-------------------+-------------+------+----
| ETH | VLAN | ETH |
| ADDRS | TPID | TCI | TYPE |
+-------------------+-------------+------+----
<-------- mac_len --------->
<------------->
to be removed
- After skb_reorder_vlan_header()
mac_header data
v v
+-------------------+------+----
| ETH | ETH |
| ADDRS | TYPE |
+-------------------+------+----
<-------- mac_len --------->
This is ok, but in rx double tag case, it corrupts packets:
- Before skb_reorder_vlan_header()
mac_header data
v v
+-------------------+-------------+-------------+------+----
| ETH | VLAN | VLAN | ETH |
| ADDRS | TPID | TCI | TPID | TCI | TYPE |
+-------------------+-------------+-------------+------+----
<--------------- mac_len ---------------->
<------------->
should be removed
<--------------------------->
actually will be removed
- After skb_reorder_vlan_header()
mac_header data
v v
+-------------------+------+----
| ETH | ETH |
| ADDRS | TYPE |
+-------------------+------+----
<--------------- mac_len ---------------->
So, two of vlan tags are both removed while only inner one should be
removed and mac_header (and mac_len) is broken.
skb_vlan_untag() is meant for removing the vlan header at (skb->data - 2),
so use skb->data and skb->mac_header to calculate the right offset.
Reported-by: Brandon Carpenter <brandon.carpenter@cypherpath.com >
Fixes: a6e18ff111 ("vlan: Fix untag operations of stacked vlans with REORDER_HEADER off")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp >
Signed-off-by: David S. Miller <davem@davemloft.net >
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-05-30 07:52:16 +02:00
..
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2018-03-03 10:24:29 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 10:04:46 -07:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2018-03-28 18:24:29 +02:00
2017-05-11 00:21:54 +09:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-08-31 17:32:38 -04:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-12-05 11:26:34 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 10:04:46 -07:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2018-05-30 07:52:16 +02:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-05-11 00:21:54 +09:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2018-02-03 17:39:02 +01:00
2017-11-02 11:19:54 +01:00
2018-04-29 11:33:14 +02:00
2017-11-02 11:19:54 +01:00
2018-03-03 10:24:34 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-10-19 22:13:40 -04:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-08-28 08:33:20 -07:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2018-05-25 16:17:35 +02:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2018-05-22 18:54:04 +02:00
2017-11-02 11:19:54 +01:00
2018-02-16 20:22:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-08-14 11:53:34 +02:00
2017-11-02 11:19:54 +01:00
2018-04-24 09:36:37 +02:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-30 08:40:40 +00:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 10:04:46 -07:00
2017-11-02 11:20:11 +01:00
2018-05-22 18:54:04 +02:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-08-07 14:16:22 -07:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2018-04-08 14:26:30 +02:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-12-25 14:26:33 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-08-04 10:30:27 +02:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-30 08:40:40 +00:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-02-27 16:31:23 +02:00
2017-04-11 00:28:41 +03:00
2017-08-24 09:57:28 +02:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00
2017-11-02 11:19:54 +01:00
2017-11-02 11:20:11 +01:00