android_kernel_motorola_sm6375/net/bridge
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Ahern a173f066c7 netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev
For starters, the bridge netfilter code registers operations that
are invoked any time nh_hook is called. Specifically, ip_sabotage_in
watches for nested calls for NF_INET_PRE_ROUTING when a bridge is in
the stack.

Packet wise, the bridge netfilter hook runs first. br_nf_pre_routing
allocates nf_bridge, sets in_prerouting to 1 and calls NF_HOOK for
NF_INET_PRE_ROUTING. It's finish function, br_nf_pre_routing_finish,
then resets in_prerouting flag to 0 and the packet continues up the
stack. The packet eventually makes it to the VRF driver and it invokes
nf_hook for NF_INET_PRE_ROUTING in case any rules have been added against
the vrf device.

Because of the registered operations the call to nf_hook causes
ip_sabotage_in to be invoked. That function sees the nf_bridge on the
skb and that in_prerouting is not set. Thinking it is an invalid nested
call it steals (drops) the packet.

Update ip_sabotage_in to recognize that the bridge or one of its upper
devices (e.g., vlan) can be enslaved to a VRF (L3 master device) and
allow the packet to go through the nf_hook a second time.

Fixes: 73e20b761a ("net: vrf: Add support for PREROUTING rules on vrf device")
Reported-by: D'Souza, Nelson <[email protected]>
Signed-off-by: David Ahern <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
2018-09-20 18:24:14 +02:00
..
netfilter netfilter: bridge: Expose nf_tables bridge hook priorities through uapi 2018-08-03 21:15:09 +02:00
br.c
br_arp_nd_proxy.c
br_device.c
br_fdb.c net: bridge: Fix locking in br_fdb_find_port() 2018-06-08 19:58:31 -04:00
br_forward.c net: bridge: add support for backup port 2018-07-23 09:32:15 -07:00
br_if.c net: bridge: add support for backup port 2018-07-23 09:32:15 -07:00
br_input.c
br_ioctl.c
br_mdb.c
br_multicast.c net/bridge/br_multicast: remove redundant variable "err" 2018-08-06 10:33:44 -07:00
br_netfilter_hooks.c netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev 2018-09-20 18:24:14 +02:00
br_netfilter_ipv6.c
br_netlink.c net: bridge: add support for backup port 2018-07-23 09:32:15 -07:00
br_netlink_tunnel.c
br_nf_core.c
br_private.h net: bridge: add support for backup port 2018-07-23 09:32:15 -07:00
br_private_stp.h
br_private_tunnel.h
br_stp.c
br_stp_bpdu.c
br_stp_if.c
br_stp_timer.c
br_switchdev.c
br_sysfs_br.c
br_sysfs_if.c net: bridge: add support for backup port 2018-07-23 09:32:15 -07:00
br_vlan.c
br_vlan_tunnel.c
Kconfig
Makefile