linux/net/bridge
Florian Westphal 491de848db netfilter: bridge: ebt_among: add more missing match size checks
commit c8d70a700a upstream.

ebt_among is special, it has a dynamic match size and is exempt
from the central size checks.

commit c4585a2823 ("bridge: ebt_among: add missing match size checks")
added validation for pool size, but missed fact that the macros
ebt_among_wh_src/dst can already return out-of-bound result because
they do not check value of wh_src/dst_ofs (an offset) vs. the size
of the match that userspace gave to us.

v2:
check that offset has correct alignment.
Paolo Abeni points out that we should also check that src/dst
wormhash arrays do not overlap, and src + length lines up with
start of dst (or vice versa).
v3: compact wormhash_sizes_valid() part

NB: Fixes tag is intentionally wrong, this bug exists from day
one when match was added for 2.6 kernel. Tag is there so stable
maintainers will notice this one too.

Tested with same rules from the earlier patch.

Fixes: c4585a2823 ("bridge: ebt_among: add missing match size checks")
Reported-by: <syzbot+bdabab6f1983a03fc009@syzkaller.appspotmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-06-16 22:22:37 +01:00
..
netfilter netfilter: bridge: ebt_among: add more missing match size checks 2018-06-16 22:22:37 +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 bridge: use is_skb_forwardable in forward path 2014-03-31 16:04:04 -04: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