All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bridge] [PATCH net-next] net: bridge: Lock before br_fdb_find()
@ 2018-05-28 15:44 ` Petr Machata
  0 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-05-28 15:44 UTC (permalink / raw)
  To: bridge, netdev; +Cc: davem

Callers of br_fdb_find() need to hold the hash lock, which
br_fdb_find_port() doesn't do. Add the missing lock/unlock
pair.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 net/bridge/br_fdb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b19e310..3f5691a 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -135,9 +135,11 @@ struct net_device *br_fdb_find_port(const struct net_device *br_dev,
 		return NULL;
 
 	br = netdev_priv(br_dev);
+	spin_lock_bh(&br->hash_lock);
 	f = br_fdb_find(br, addr, vid);
 	if (f && f->dst)
 		dev = f->dst->dev;
+	spin_unlock_bh(&br->hash_lock);
 
 	return dev;
 }
-- 
2.4.11


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-05-30 22:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-28 15:44 [Bridge] [PATCH net-next] net: bridge: Lock before br_fdb_find() Petr Machata
2018-05-28 15:44 ` Petr Machata
2018-05-28 15:52 ` [Bridge] " Nikolay Aleksandrov
2018-05-28 15:52   ` Nikolay Aleksandrov
2018-05-28 15:53   ` [Bridge] " Nikolay Aleksandrov
2018-05-28 15:53     ` Nikolay Aleksandrov
2018-05-28 16:19     ` [Bridge] " Petr Machata
2018-05-28 16:19       ` Petr Machata
2018-05-28 17:42 ` [Bridge] " Stephen Hemminger
2018-05-28 17:42   ` Stephen Hemminger
2018-05-30 16:42 ` [Bridge] " David Miller
2018-05-30 16:42   ` David Miller
2018-05-30 22:03   ` [Bridge] " Petr Machata
2018-05-30 22:03     ` Petr Machata

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.