linux/net/bridge
Yunjian Wang 037cdae762 net: bridge: Fix ethernet header pointer before check skb forwardable
commit 28c1382fa2 upstream.

The skb header should be set to ethernet header before using
is_skb_forwardable. Because the ethernet header length has been
considered in is_skb_forwardable(including dev->hard_header_len
length).

To reproduce the issue:
1, add 2 ports on linux bridge br using following commands:
$ brctl addbr br
$ brctl addif br eth0
$ brctl addif br eth1
2, the MTU of eth0 and eth1 is 1500
3, send a packet(Data 1480, UDP 8, IP 20, Ethernet 14, VLAN 4)
from eth0 to eth1

So the expect result is packet larger than 1500 cannot pass through
eth0 and eth1. But currently, the packet passes through success, it
means eth1's MTU limit doesn't take effect.

Fixes: f6367b4660 ("bridge: use is_skb_forwardable in forward path")
Cc: bridge@lists.linux-foundation.org
Cc: Nkolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: Roopa Prabhu <roopa@cumulusnetworks.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16:
 - br_dev_queue_push_xmit() has to call nf_bridge_maybe_copy_header()
   before pushing the Ethernet header
 - adjust context, indentation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-05-02 21:41:25 +01:00
..
netfilter netfilter: ebtables: handle string from userspace with care 2018-10-21 08:46:12 +01:00
br.c bridge: make br_device_notifier static 2014-05-22 15:33:47 -04:00
br_device.c net: bridge: fix dest lookup when vlan proto doesn't match 2017-11-11 13:32:53 +00:00
br_fdb.c bridge: disable softirqs around br_fdb_update to avoid lockup 2015-06-12 13:40:05 +01:00
br_forward.c net: bridge: Fix ethernet header pointer before check skb forwardable 2019-05-02 21:41:25 +01:00
br_if.c bridge: Fix incorrect judgment of promisc 2014-06-05 15:20:31 -07:00
br_input.c net: bridge: fix dest lookup when vlan proto doesn't match 2017-11-11 13:32:53 +00:00
br_ioctl.c net: bridge: fix old ioctl unlocked net device walk 2017-03-16 02:27:17 +00:00
br_mdb.c bridge: mdb: fix delmdb state in the notification 2015-08-25 10:13:53 +01:00
br_multicast.c bridge: multicast: restore perm router ports on multicast enable 2017-02-23 03:54:17 +00:00
br_netfilter.c dst: Increase alignment of metrics to allow extra flag on pointers 2017-11-11 13:33:20 +00:00
br_netlink.c net: bridge: fix early call to br_stp_change_bridge_id and plug newlink leaks 2018-03-03 15:52:01 +00:00
br_private.h Bridge: Fix ipv6 mc snooping if bridge has no ipv6 address 2016-08-22 22:38:23 +01:00
br_private_stp.h net: 8021q/bluetooth/bridge/can/ceph: Remove extern from function prototypes 2013-10-19 19:12:11 -04:00
br_stp.c bridge: Clamp forward_delay when enabling STP 2013-09-12 23:32:14 -04:00
br_stp_bpdu.c br: fix use of ->rx_handler_data in code executed on non-rx_handler path 2013-12-06 15:41:40 -05:00
br_stp_if.c bridge: Only call /sbin/bridge-stp for the initial network namespace 2016-01-28 10:27:12 +00:00
br_stp_timer.c bridge: add space before '(/{', after ',', etc. 2013-12-19 19:27:26 -05:00
br_sysfs_br.c bridge: Support 802.1ad vlan filtering 2014-06-11 15:22:53 -07:00
br_sysfs_if.c bridge: check brport attr show in brport_show 2018-06-16 22:22:13 +01:00
br_vlan.c bridge: Fix br_should_learn to check vlan_enabled 2014-10-15 12:05:28 +02:00
Kconfig bridge: Add vlan filtering infrastructure 2013-02-13 19:41:46 -05:00
Makefile netfilter: bridge: fix Kconfig unmet dependencies 2014-05-26 00:42:30 -04:00