WSL2-Linux-Kernel/net/bridge
Ido Schimmel 4f2c6ae5c6 switchdev: Require RTNL mutex to be held when sending FDB notifications
When switchdev drivers process FDB notifications from the underlying
device they resolve the netdev to which the entry points to and notify
the bridge using the switchdev notifier.

However, since the RTNL mutex is not held there is nothing preventing
the netdev from disappearing in the middle, which will cause
br_switchdev_event() to dereference a non-existing netdev.

Make switchdev drivers hold the lock at the beginning of the
notification processing session and release it once it ends, after
notifying the bridge.

Also, remove switchdev_mutex and fdb_lock, as they are no longer needed
when RTNL mutex is held.

Fixes: 03bf0c2812 ("switchdev: introduce switchdev notifier")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-28 16:21:31 -08:00
..
netfilter netfilter: nf_tables: release objects on netns destruction 2015-12-28 18:34:35 +01:00
Kconfig
Makefile
br.c switchdev: Require RTNL mutex to be held when sending FDB notifications 2016-01-28 16:21:31 -08:00
br_device.c bridge: fix lockdep addr_list_lock false positive splat 2016-01-15 15:40:45 -05:00
br_fdb.c switchdev: Pass original device to port netdev driver 2015-12-15 11:58:20 -05:00
br_forward.c bridge: set is_local and is_static before fdb entry is added to the fdb hashtable 2015-10-30 12:13:05 +09:00
br_if.c bridge: Propagate vlan add failure to user 2016-01-06 14:42:40 -05:00
br_input.c
br_ioctl.c
br_mdb.c bridge: Reflect MDB entries to hardware 2016-01-10 16:50:21 -05:00
br_multicast.c
br_netfilter_hooks.c
br_netfilter_ipv6.c
br_netlink.c netlink: Rightsize IFLA_AF_SPEC size calculation 2015-10-21 19:15:20 -07:00
br_nf_core.c
br_private.h
br_private_stp.h
br_stp.c switchdev: Pass original device to port netdev driver 2015-12-15 11:58:20 -05:00
br_stp_bpdu.c
br_stp_if.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-06 22:54:18 -05:00
br_stp_timer.c
br_sysfs_br.c bridge: use kobj_to_dev instead of to_dev 2015-12-23 22:26:48 -05:00
br_sysfs_if.c
br_vlan.c bridge: add vlan filtering change for new bridged device 2016-01-06 14:42:41 -05:00