1
0
Fork 0
remarkable-linux/net/switchdev
Ido Schimmel 4c62ddf7e3 switchdev: Require RTNL mutex to be held when sending FDB notifications
[ Upstream commit 4f2c6ae5c6 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-03-04 10:25:47 -05:00
..
Kconfig kconfig: use bool instead of boolean for type definition attributes 2015-01-07 13:08:04 +01:00
Makefile net: introduce generic switch devices support 2014-12-02 20:01:20 -08:00
switchdev.c switchdev: Require RTNL mutex to be held when sending FDB notifications 2016-03-04 10:25:47 -05:00