linux/net/bridge
Nikolay Aleksandrov 44da7386bb bridge: disable softirqs around br_fdb_update to avoid lockup
[ Upstream commit c4c832f89d ]

br_fdb_update() can be called in process context in the following way:
br_fdb_add() -> __br_fdb_add() -> br_fdb_update() (if NTF_USE flag is set)
so we need to disable softirqs because there are softirq users of the
hash_lock. One easy way to reproduce this is to modify the bridge utility
to set NTF_USE, enable stp and then set maxageing to a low value so
br_fdb_cleanup() is called frequently and then just add new entries in
a loop. This happens because br_fdb_cleanup() is called from timer/softirq
context. The spin locks in br_fdb_update were _bh before commit f8ae737dee
("[BRIDGE]: forwarding remove unneeded preempt and bh diasables")
and at the time that commit was correct because br_fdb_update() couldn't be
called from process context, but that changed after commit:
292d139898 ("bridge: add NTF_USE support")
Using local_bh_disable/enable around br_fdb_update() allows us to keep
using the spin_lock/unlock in br_fdb_update for the fast-path.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: 292d139898 ("bridge: add NTF_USE support")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-22 17:01:18 -07:00
..
netfilter netfilter: Can't fail and free after table replacement 2014-05-31 13:20:28 -07:00
Kconfig bridge: Add vlan filtering infrastructure 2013-02-13 19:41:46 -05:00
Makefile bridge: Add vlan filtering infrastructure 2013-02-13 19:41:46 -05:00
br.c bridge: move br_net_exit() to br.c 2014-01-13 23:42:39 -08:00
br_device.c bridge: Fix inabillity to retrieve vlan tags when tx offload is disabled 2014-03-28 16:33:09 -04:00
br_fdb.c bridge: disable softirqs around br_fdb_update to avoid lockup 2015-06-22 17:01:18 -07:00
br_forward.c bridge: remove unnecessary parentheses 2013-12-19 19:27:26 -05:00
br_if.c bridge: Change local fdb entries whenever mac address of bridge device changes 2014-02-10 14:34:33 -08:00
br_input.c bridge: Prevent insertion of FDB entry with disallowed vlan 2014-06-26 15:15:39 -04:00
br_ioctl.c bridge: add space before '(/{', after ',', etc. 2013-12-19 19:27:26 -05:00
br_mdb.c Revert "bridge: only expire the mdb entry when query is received" 2013-10-22 14:41:02 -04:00
br_multicast.c bridge: fix parsing of MLDv2 reports 2015-06-22 17:01:17 -07:00
br_netfilter.c bridge: change "foo* bar" to "foo *bar" 2013-12-19 19:27:26 -05:00
br_netlink.c bridge: Handle IFLA_ADDRESS correctly when creating bridge device 2014-05-31 13:20:35 -07:00
br_notify.c net: convert resend IGMP to notifier event 2013-07-23 16:52:47 -07:00
br_private.h bridge: Check if vlan filtering is enabled only once. 2014-10-15 08:36:41 +02: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: Change local fdb entries whenever mac address of bridge device changes 2014-02-10 14:34:33 -08:00
br_stp_timer.c bridge: add space before '(/{', after ',', etc. 2013-12-19 19:27:26 -05:00
br_sysfs_br.c bridge: use DEVICE_ATTR_xx macros 2014-01-06 16:40:46 -05:00
br_sysfs_if.c bridge: change "foo* bar" to "foo *bar" 2013-12-19 19:27:26 -05:00
br_vlan.c bridge: Fix br_should_learn to check vlan_enabled 2014-10-15 08:36:41 +02:00