diff options
author | Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> | 2016-09-20 12:48:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-22 01:35:57 -0400 |
commit | 636c2628086e40c86dac7ddc84a1c4b4fcccc6e3 (patch) | |
tree | 5fe005b7808e9838a9f20d63ca9ab8650dbcf662 /usr | |
parent | 1fbafcb84747d0784fe928bedc4189f47d18ad8f (diff) | |
download | linux-stable-636c2628086e40c86dac7ddc84a1c4b4fcccc6e3.tar.gz linux-stable-636c2628086e40c86dac7ddc84a1c4b4fcccc6e3.tar.bz2 linux-stable-636c2628086e40c86dac7ddc84a1c4b4fcccc6e3.zip |
net: skbuff: Remove errornous length validation in skb_vlan_pop()
In 93515d53b1
"net: move vlan pop/push functions into common code"
skb_vlan_pop was moved from its private location in openvswitch to
skbuff common code.
In case skb has non hw-accel vlan tag, the original 'pop_vlan()' assured
that skb->len is sufficient (if skb->len < VLAN_ETH_HLEN then pop was
considered a no-op).
This validation was moved as is into the new common 'skb_vlan_pop'.
Alas, in its original location (openvswitch), there was a guarantee that
'data' points to the mac_header, therefore the 'skb->len < VLAN_ETH_HLEN'
condition made sense.
However there's no such guarantee in the generic 'skb_vlan_pop'.
For short packets received in rx path going through 'skb_vlan_pop',
this causes 'skb_vlan_pop' to fail pop-ing a valid vlan hdr (in the non
hw-accel case) or to fail moving next tag into hw-accel tag.
Remove the 'skb->len < VLAN_ETH_HLEN' condition entirely:
It is superfluous since inner '__skb_vlan_pop' already verifies there
are VLAN_ETH_HLEN writable bytes at the mac_header.
Note this presents a slight change to skb_vlan_pop() users:
In case total length is smaller than VLAN_ETH_HLEN, skb_vlan_pop() now
returns an error, as opposed to previous "no-op" behavior.
Existing callers (e.g. tc act vlan, ovs) usually drop the packet if
'skb_vlan_pop' fails.
Fixes: 93515d53b1 ("net: move vlan pop/push functions into common code")
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Cc: Pravin Shelar <pshelar@ovn.org>
Reviewed-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions