bridge: netlink: fix slave_changelink/br_setport race conditions
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Wed, 22 Jul 2015 11:03:40 +0000 (13:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Jul 2015 23:27:22 +0000 (16:27 -0700)
commit963ad94853000ab100f5ff19eea80095660d41b4
treefaa6faa5e27de62c37c0b30bcd96ed4158985be7
parent485164381c1d663d3be1c9d2c600be0fb80a68ad
bridge: netlink: fix slave_changelink/br_setport race conditions

Since slave_changelink support was added there have been a few race
conditions when using br_setport() since some of the port functions it
uses require the bridge lock. It is very easy to trigger a lockup due to
some internal spin_lock() usage without bh disabled, also it's possible to
get the bridge into an inconsistent state.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: 3ac636b8591c ("bridge: implement rtnl_link_ops->slave_changelink")
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netlink.c