public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: bridge: Lock before br_fdb_find()
@ 2018-05-28 15:44 Petr Machata
  2018-05-28 15:52 ` Nikolay Aleksandrov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Petr Machata @ 2018-05-28 15:44 UTC (permalink / raw)
  To: bridge, netdev; +Cc: stephen, 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] 7+ messages in thread

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

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox