[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <012aee15-9e57-0267-cc3a-3b091977fa3f@cumulusnetworks.com>
Date: Mon, 28 May 2018 18:53:58 +0300
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Petr Machata <petrm@...lanox.com>,
bridge@...ts.linux-foundation.org, netdev@...r.kernel.org
Cc: stephen@...workplumber.org, davem@...emloft.net
Subject: Re: [PATCH net-next] net: bridge: Lock before br_fdb_find()
On 28/05/18 18:52, Nikolay Aleksandrov wrote:
> On 28/05/18 18:44, Petr Machata wrote:
>> 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@...lanox.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;
>> }
>>
>
> There's also a lockdep assert for hash_lock in br_find_fdb().
>
> Acked-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
>
Fixes: 4d4fd36126d6 ("net: bridge: Publish bridge accessor functions")
Powered by blists - more mailing lists