netdev
[Top] [All Lists]

[patch 2/2] [PATCH] br: fix race on bridge del if

To: linux-kernel@xxxxxxxxxxxxxxx, stable@xxxxxxxxxx
Subject: [patch 2/2] [PATCH] br: fix race on bridge del if
From: Greg Kroah-Hartman <gregkh@xxxxxxx>
Date: Tue, 13 Dec 2005 13:59:54 -0800
Cc: Justin Forbes <jmforbes@xxxxxxxxxxx>, Zwane Mwaikambo <zwane@xxxxxxxxxxxxxxxx>, "Theodore Ts'o" <tytso@xxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxx>, Dave Jones <davej@xxxxxxxxxx>, Chuck Wolber <chuckw@xxxxxxxxxxxxxxxx>, torvalds@xxxxxxxx, akpm@xxxxxxxx, alan@xxxxxxxxxxxxxxxxxxx, ryanh@xxxxxxxxxx, davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20051213215936.GA16739@xxxxxxxxx>
References: <20051213214109.971735000@xxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.11
-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stephen Hemminger <shemminger@xxxxxxxx>

This fixes the RCU race on bridge delete interface.  Basically,
the network device has to be detached from the bridge in the first
step (pre-RCU), rather than later. At that point, no more bridge traffic
will come in, and the other code will not think that network device
is part of a bridge.

This should also fix the XEN test problems. If there is another
2.6.13-stable, add it as well.

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxx>
Signed-off-by: Chris Wright <chrisw@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 net/bridge/br_if.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.13.4.orig/net/bridge/br_if.c
+++ linux-2.6.13.4/net/bridge/br_if.c
@@ -79,7 +79,6 @@ static void destroy_nbp(struct net_bridg
 {
        struct net_device *dev = p->dev;
 
-       dev->br_port = NULL;
        p->br = NULL;
        p->dev = NULL;
        dev_put(dev);
@@ -100,6 +99,7 @@ static void del_nbp(struct net_bridge_po
        struct net_bridge *br = p->br;
        struct net_device *dev = p->dev;
 
+       dev->br_port = NULL;
        dev_set_promiscuity(dev, -1);
 
        spin_lock_bh(&br->lock);

--

<Prev in Thread] Current Thread [Next in Thread>
  • [patch 2/2] [PATCH] br: fix race on bridge del if, Greg Kroah-Hartman <=