bridge: fix race with topology change timer
Subsystems (3)
PATCH 1/1 bridge: fix race with topology change timer
A bridge should only send topology change notice if it is not the root bridge. It is possible for message age timer to elect itself as a new root bridge, and still have a topology change timer running but waiting for bridge lock on other CPU.
Solve the race by checking if we are root bridge before continuing. This was the root cause of the cases where br_send_tcn_bpdu would OOPS.
---
Patch against current net (for 3.10 merge window)
Should go to stable
net/bridge/br_stp_timer.c +1 -1
@@ -107,7 +107,7 @@ static void br_tcn_timer_expired(unsignebr_debug (br,"tcn timer expired\n" );spin_lock (&br->lock); -if (br->dev->flags &IFF_UP ) { +if (!br_is_root_bridge (br) && (br->dev->flags &IFF_UP )) {br_transmit_tcn (br);mod_timer (&br->tcn_timer,jiffies + br->bridge_hello_time);
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 2 May 2013 17:23:28 -0700
Quoted 10 lines
A bridge should only send topology change notice if it is not the root bridge. It is possible for message age timer to elect itself as a new root bridge, and still have a topology change timer running but waiting for bridge lock on other CPU.
Solve the race by checking if we are root bridge before continuing. This was the root cause of the cases where
br_send_tcn_bpduwould OOPS.Reported-by JerryKang <[email protected]>Signed-off-by Stephen Hemminger <[email protected]>
Applied and queued up for -stable.