linux_dsm_epyc7002/drivers/net/ethernet/mellanox/mlxsw
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
..
cmd.h mlxsw: cmd: Introduce FID-offset flooding tables 2015-10-16 07:15:10 -07:00
core_hwmon.c mlxsw: core: remove an unnecessary condition 2016-01-06 15:07:47 -05:00
core.c mlxsw: core: Use devm_kzalloc to allocate mlxsw_hwmon structure 2015-12-22 16:25:09 -05:00
core.h mlxsw: core: Use devm_kzalloc to allocate mlxsw_hwmon structure 2015-12-22 16:25:09 -05:00
emad.h mlxsw: Add interface to access registers and process events 2015-07-30 00:05:00 -07:00
item.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-20 06:08:27 -07:00
Kconfig mlxsw: spectrum: Adjust switchdev ops for VLAN devices 2015-12-15 11:58:22 -05:00
Makefile mlxsw: core: Implement temperature hwmon interface 2015-11-30 15:05:40 -05:00
pci.c mlxsw: pci: Adjust value of CPU egress traffic class 2016-01-06 00:48:50 -05:00
pci.h mlxsw: pci: Implement LAG processing for received packets 2015-12-03 11:49:28 -05:00
port.h mlxsw: Introduce Mellanox SwitchX-2 ASIC support 2015-07-30 00:05:00 -07:00
reg.h mlxsw: reg: Use correct offset in field definiton 2016-01-28 15:55:32 -08:00
spectrum_buffers.c mlxsw: spectrum: Add initial support for Spectrum ASIC 2015-10-16 07:15:23 -07:00
spectrum_switchdev.c switchdev: Require RTNL mutex to be held when sending FDB notifications 2016-01-28 16:21:31 -08:00
spectrum.c mlxsw: spectrum: Flush FDB when leaving bridge 2016-01-28 15:55:30 -08:00
spectrum.h switchdev: Require RTNL mutex to be held when sending FDB notifications 2016-01-28 16:21:31 -08:00
switchx2.c mlxsw: Put constant on the right side of comparisons 2015-10-30 12:26:54 +09:00
trap.h mlxsw: Introduce Mellanox switch driver core 2015-07-30 00:04:59 -07:00
txheader.h mlxsw: spectrum: Add initial support for Spectrum ASIC 2015-10-16 07:15:23 -07:00