From: David Miller <davem@davemloft.net>
To: jiri@resnulli.us
Cc: netdev@vger.kernel.org, idosch@mellanox.com, eladr@mellanox.com,
yotamg@mellanox.com, ogerlitz@mellanox.com,
stephen@networkplumber.org, sfeldma@gmail.com
Subject: Re: [patch net] switchdev: Require RTNL mutex to be held when sending FDB notifications
Date: Thu, 28 Jan 2016 16:22:15 -0800 (PST) [thread overview]
Message-ID: <20160128.162215.1495832301297951482.davem@davemloft.net> (raw)
In-Reply-To: <1453904203-4908-1-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 27 Jan 2016 15:16:43 +0100
> From: Ido Schimmel <idosch@mellanox.com>
>
> When switchdev drivers process FDB notifications from the underlying
> device they resolve the netdev to which the entry points to and notify
> the bridge using the switchdev notifier.
>
> However, since the RTNL mutex is not held there is nothing preventing
> the netdev from disappearing in the middle, which will cause
> br_switchdev_event() to dereference a non-existing netdev.
>
> Make switchdev drivers hold the lock at the beginning of the
> notification processing session and release it once it ends, after
> notifying the bridge.
>
> Also, remove switchdev_mutex and fdb_lock, as they are no longer needed
> when RTNL mutex is held.
>
> Fixes: 03bf0c281234 ("switchdev: introduce switchdev notifier")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Applied and queued up for -stable, thanks Jiri.
prev parent reply other threads:[~2016-01-29 0:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 14:16 [patch net] switchdev: Require RTNL mutex to be held when sending FDB notifications Jiri Pirko
2016-01-29 0:22 ` David Miller [this message]
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=20160128.162215.1495832301297951482.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eladr@mellanox.com \
--cc=idosch@mellanox.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=sfeldma@gmail.com \
--cc=stephen@networkplumber.org \
--cc=yotamg@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;
as well as URLs for NNTP newsgroup(s).