Files
twx-linux/include/net
Shmulik Ladkani 9edbf4a0b6 net/sched: act_vlan: Push skb->data to mac_header prior calling skb_vlan_*() functions
[ Upstream commit f39acc84aa ]

Generic skb_vlan_push/skb_vlan_pop functions don't properly handle the
case where the input skb data pointer does not point at the mac header:

- They're doing push/pop, but fail to properly unwind data back to its
  original location.
  For example, in the skb_vlan_push case, any subsequent
  'skb_push(skb, skb->mac_len)' calls make the skb->data point 4 bytes
  BEFORE start of frame, leading to bogus frames that may be transmitted.

- They update rcsum per the added/removed 4 bytes tag.
  Alas if data is originally after the vlan/eth headers, then these
  bytes were already pulled out of the csum.

OTOH calling skb_vlan_push/skb_vlan_pop with skb->data at mac_header
present no issues.

act_vlan is the only caller to skb_vlan_*() that has skb->data pointing
at network header (upon ingress).
Other calles (ovs, bpf) already adjust skb->data at mac_header.

This patch fixes act_vlan to point to the mac_header prior calling
skb_vlan_*() functions, as other callers do.

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Pravin Shelar <pshelar@ovn.org>
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-15 07:46:37 +01:00
..
…
…
…
…
…
…
2015-06-28 16:55:44 -07:00
…
2016-04-20 15:42:04 +09:00
…
…
…
…
2015-09-17 17:18:37 -07:00
…
…
…
2015-12-14 23:52:00 -05:00
…
…
…
2015-09-24 12:25:23 -07:00
…
…
2015-11-02 22:47:14 -05:00
2015-12-07 17:07:33 -05:00
…
…
…
…
…
…
…
2015-10-08 04:27:03 -07:00
…
…
2015-10-23 06:26:42 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-11-15 07:46:36 +01:00
…
…
2015-10-26 22:24:22 -07:00
…
…
…
…
…