[kernel/f19] Fix timer issue in bridge code (rhbz 980254)

Josh Boyer jwboyer at fedoraproject.org
Mon Jul 22 18:59:36 UTC 2013


commit b614c1a7bcadf1f52f43ee2685a6181596b33540
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Mon Jul 22 14:55:50 2013 -0400

    Fix timer issue in bridge code (rhbz 980254)

 ...ge-do-not-call-setup_timer-multiple-times.patch |   50 ++++++++++++++++++++
 kernel.spec                                        |    6 ++
 2 files changed, 56 insertions(+), 0 deletions(-)
---
diff --git a/bridge-do-not-call-setup_timer-multiple-times.patch b/bridge-do-not-call-setup_timer-multiple-times.patch
new file mode 100644
index 0000000..c8c7bf7
--- /dev/null
+++ b/bridge-do-not-call-setup_timer-multiple-times.patch
@@ -0,0 +1,50 @@
+From 1faabf2aab1fdaa1ace4e8c829d1b9cf7bfec2f1 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 20 Jul 2013 03:07:16 +0000
+Subject: bridge: do not call setup_timer() multiple times
+
+commit 9f00b2e7cf24 ("bridge: only expire the mdb entry when query is
+received") added a nasty bug as an active timer can be reinitialized.
+
+setup_timer() must be done once, no matter how many time mod_timer()
+is called. br_multicast_new_group() is the right place to do this.
+
+Reported-by: Srivatsa S. Bhat <srivatsa.bhat at linux.vnet.ibm.com>
+Diagnosed-by: Thomas Gleixner <tglx at linutronix.de>
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Tested-by: Srivatsa S. Bhat <srivatsa.bhat at linux.vnet.ibm.com>
+Cc: Cong Wang <amwang at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
+index 69af490..4b99c9a 100644
+--- a/net/bridge/br_multicast.c
++++ b/net/bridge/br_multicast.c
+@@ -619,6 +619,9 @@ rehash:
+ 	mp->br = br;
+ 	mp->addr = *group;
+ 
++	setup_timer(&mp->timer, br_multicast_group_expired,
++		    (unsigned long)mp);
++
+ 	hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]);
+ 	mdb->size++;
+ 
+@@ -1126,7 +1129,6 @@ static int br_ip4_multicast_query(struct net_bridge *br,
+ 	if (!mp)
+ 		goto out;
+ 
+-	setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp);
+ 	mod_timer(&mp->timer, now + br->multicast_membership_interval);
+ 	mp->timer_armed = true;
+ 
+@@ -1204,7 +1206,6 @@ static int br_ip6_multicast_query(struct net_bridge *br,
+ 	if (!mp)
+ 		goto out;
+ 
+-	setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp);
+ 	mod_timer(&mp->timer, now + br->multicast_membership_interval);
+ 	mp->timer_armed = true;
+ 
+--
+cgit v0.9.2
diff --git a/kernel.spec b/kernel.spec
index 1b16cf7..b448eb6 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -755,6 +755,7 @@ Patch25053: bridge-only-expire-the-mdb-entry-when-query-is-received.patch
 Patch25054: bridge-send-query-as-soon-as-leave-is-received.patch
 #rhbz 980254
 Patch25061: bridge-timer-fix.patch
+Patch25066: bridge-do-not-call-setup_timer-multiple-times.patch
 
 #rhbz 977558
 Patch25055: ath3k-dont-use-stack-memory-for-DMA.patch
@@ -1475,7 +1476,9 @@ ApplyPatch HID-input-return-ENODATA-if-reading-battery-attrs-fails.patch
 #rhbz 880035
 ApplyPatch bridge-only-expire-the-mdb-entry-when-query-is-received.patch
 ApplyPatch bridge-send-query-as-soon-as-leave-is-received.patch
+#rhbz 980254
 ApplyPatch bridge-timer-fix.patch
+ApplyPatch bridge-do-not-call-setup_timer-multiple-times.patch
 
 #rhbz 977558
 ApplyPatch ath3k-dont-use-stack-memory-for-DMA.patch
@@ -2303,6 +2306,9 @@ fi
 # and build.
 
 %changelog
+* Mon Jul 22 2013 Josh Boyer <jwboyer at redhat.com>
+- Fix timer issue in bridge code (rhbz 980254)
+
 * Mon Jul 22 2013 Justin M. Forbes <jforbes at redhat.com> 3.10.2-300
 - Linux v3.10.2
 


More information about the scm-commits mailing list