2006-02-27 22:34:44

by Chris Wright

[permalink] [raw]
Subject: [patch 15/39] [PATCH] [BRIDGE]: Fix deadlock in br_stp_disable_bridge

-stable review patch. If anyone has any objections, please let us know.
------------------

Looks like somebody forgot to use the _bh spin_lock variant. We ran into a
deadlock where br->hello_timer expired while br_stp_disable_br() walked
br->port_list.

Signed-off-by: Adrian Drzewiecki <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: "David S. Miller" <[email protected]>
Signed-off-by: Chris Wright <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---

net/bridge/br_stp_if.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.15.4.orig/net/bridge/br_stp_if.c
+++ linux-2.6.15.4/net/bridge/br_stp_if.c
@@ -67,7 +67,7 @@ void br_stp_disable_bridge(struct net_br
{
struct net_bridge_port *p;

- spin_lock(&br->lock);
+ spin_lock_bh(&br->lock);
list_for_each_entry(p, &br->port_list, list) {
if (p->state != BR_STATE_DISABLED)
br_stp_disable_port(p);
@@ -76,7 +76,7 @@ void br_stp_disable_bridge(struct net_br

br->topology_change = 0;
br->topology_change_detected = 0;
- spin_unlock(&br->lock);
+ spin_unlock_bh(&br->lock);

del_timer_sync(&br->hello_timer);
del_timer_sync(&br->topology_change_timer);

--