diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-11-15 01:38:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-15 14:13:17 -0500 |
commit | b5ed54e94d324f17c97852296d61a143f01b227a (patch) | |
tree | 2104d3cde24efc1145bc71beb4b61d79ed841132 /net/bridge/br_if.c | |
parent | 61391cde9eefac5cfcf6d214aa80c77e58b1626b (diff) |
bridge: fix RCU races with bridge port
The macro br_port_exists() is not enough protection when only
RCU is being used. There is a tiny race where other CPU has cleared port
handler hook, but is bridge port flag might still be set.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r-- | net/bridge/br_if.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 89ad25a76202..427f90a8ab7b 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -475,11 +475,8 @@ int br_del_if(struct net_bridge *br, struct net_device *dev) | |||
475 | { | 475 | { |
476 | struct net_bridge_port *p; | 476 | struct net_bridge_port *p; |
477 | 477 | ||
478 | if (!br_port_exists(dev)) | ||
479 | return -EINVAL; | ||
480 | |||
481 | p = br_port_get(dev); | 478 | p = br_port_get(dev); |
482 | if (p->br != br) | 479 | if (!p || p->br != br) |
483 | return -EINVAL; | 480 | return -EINVAL; |
484 | 481 | ||
485 | del_nbp(p); | 482 | del_nbp(p); |