From: Stephen Hemminger <stephen@networkplumber.org>
To: Petr Machata <petrm@mellanox.com>
Cc: bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
davem@davemloft.net
Subject: Re: [PATCH net-next] net: bridge: Lock before br_fdb_find()
Date: Mon, 28 May 2018 10:42:53 -0700 [thread overview]
Message-ID: <20180528104253.64e10ffc@xeon-e3> (raw)
In-Reply-To: <ff84c00d882dc646a7d69dcbdfe8417b4c0bdf91.1527522008.git.petrm@mellanox.com>
On Mon, 28 May 2018 17:44:16 +0200
Petr Machata <petrm@mellanox.com> 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@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;
> }
Sigh. when did br_fdb_find start needing hash_lock?
What is the point of RCU then?
next prev parent reply other threads:[~2018-05-28 17:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2018-05-30 16:42 ` David Miller
2018-05-30 22:03 ` Petr Machata
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180528104253.64e10ffc@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox