lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1301423072-28093-1-git-send-email-sasikanth.v19@gmail.com>
Date:	Tue, 29 Mar 2011 23:54:32 +0530
From:	Sasikanth V <sasikanth.v19@...il.com>
To:	shemminger@...ux-foundation.org
Cc:	netdev@...r.kernel.org, bridge@...ts.linux-foundation.org,
	Sasikanth V <sasikanth.v19@...il.com>
Subject: [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks


Signed-off-by: Sasikanth V <sasikanth.v19@...il.com>
---
 net/bridge/br_device.c    |    5 ++++-
 net/bridge/br_stp_if.c    |    2 --
 net/bridge/br_stp_timer.c |    3 ---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 21e5901..6cc612b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -80,10 +80,13 @@ static int br_dev_open(struct net_device *dev)
 
 	netif_carrier_off(dev);
 
-	br_features_recompute(br);
 	netif_start_queue(dev);
+
+	spin_lock_bh(&br->lock);
+	br_features_recompute(br);
 	br_stp_enable_bridge(br);
 	br_multicast_open(br);
+	spin_unlock_bh(&br->lock);
 
 	return 0;
 }
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 5593f5a..472d8b2 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -44,7 +44,6 @@ void br_stp_enable_bridge(struct net_bridge *br)
 {
 	struct net_bridge_port *p;
 
-	spin_lock_bh(&br->lock);
 	mod_timer(&br->hello_timer, jiffies + br->hello_time);
 	mod_timer(&br->gc_timer, jiffies + HZ/10);
 
@@ -55,7 +54,6 @@ void br_stp_enable_bridge(struct net_bridge *br)
 			br_stp_enable_port(p);
 
 	}
-	spin_unlock_bh(&br->lock);
 }
 
 /* NO locks held */
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index 3e96514..18244b2 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -65,8 +65,6 @@ static void br_message_age_timer_expired(unsigned long arg)
 	 * check is redundant. I'm leaving it in for now, though.
 	 */
 	spin_lock(&br->lock);
-	if (p->state == BR_STATE_DISABLED)
-		goto unlock;
 	was_root = br_is_root_bridge(br);
 
 	br_become_designated_port(p);
@@ -74,7 +72,6 @@ static void br_message_age_timer_expired(unsigned long arg)
 	br_port_state_selection(br);
 	if (br_is_root_bridge(br) && !was_root)
 		br_become_root_bridge(br);
- unlock:
 	spin_unlock(&br->lock);
 }
 
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ