* Patch "bridge: netlink: fix slave_changelink/br_setport race conditions" has been added to the 4.1-stable tree
@ 2015-09-26 18:40 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-09-26 18:40 UTC (permalink / raw)
To: nikolay, davem, gregkh, jiri; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
bridge: netlink: fix slave_changelink/br_setport race conditions
to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
bridge-netlink-fix-slave_changelink-br_setport-race-conditions.patch
and it can be found in the queue-4.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Sat Sep 26 11:13:07 PDT 2015
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Wed, 22 Jul 2015 13:03:40 +0200
Subject: bridge: netlink: fix slave_changelink/br_setport race conditions
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
[ Upstream commit 963ad94853000ab100f5ff19eea80095660d41b4 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bridge/br_netlink.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -711,9 +711,17 @@ static int br_port_slave_changelink(stru
struct nlattr *tb[],
struct nlattr *data[])
{
+ struct net_bridge *br = netdev_priv(brdev);
+ int ret;
+
if (!data)
return 0;
- return br_setport(br_port_get_rtnl(dev), data);
+
+ spin_lock_bh(&br->lock);
+ ret = br_setport(br_port_get_rtnl(dev), data);
+ spin_unlock_bh(&br->lock);
+
+ return ret;
}
static int br_port_fill_slave_info(struct sk_buff *skb,
Patches currently in stable-queue which might be from nikolay@cumulusnetworks.com are
queue-4.1/bonding-correct-the-mac-address-for-follow-fail_over_mac-policy.patch
queue-4.1/bridge-netlink-fix-slave_changelink-br_setport-race-conditions.patch
queue-4.1/bridge-mdb-fix-double-add-notification.patch
queue-4.1/bridge-netlink-account-for-the-ifla_brport_proxyarp-attribute-size-and-policy.patch
queue-4.1/bonding-fix-destruction-of-bond-with-devices-different-from-arphrd_ether.patch
queue-4.1/bridge-netlink-account-for-the-ifla_brport_proxyarp_wifi-attribute-size-and-policy.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-26 18:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 18:40 Patch "bridge: netlink: fix slave_changelink/br_setport race conditions" has been added to the 4.1-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).