From: Nikolay Aleksandrov <razor@blackwall.org>
To: "Clément Léger" <clement.leger@bootlin.com>,
"Roopa Prabhu" <roopa@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Tobias Waldekranz" <tobias@waldekranz.com>
Cc: bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: bridge: switchdev: check br_vlan_group() return value
Date: Thu, 21 Apr 2022 13:17:51 +0300 [thread overview]
Message-ID: <c945ebff-02fe-f2d5-656f-6bdfc46416f1@blackwall.org> (raw)
In-Reply-To: <20220421101247.121896-1-clement.leger@bootlin.com>
On 21/04/2022 13:12, Clément Léger wrote:
> br_vlan_group() can return NULL and thus return value must be checked
> to avoid dereferencing a NULL pointer.
>
> Fixes: 6284c723d9b9 ("net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations")
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> ---
> net/bridge/br_switchdev.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
> index 81400e0b26ac..8f3d76c751dd 100644
> --- a/net/bridge/br_switchdev.c
> +++ b/net/bridge/br_switchdev.c
> @@ -354,6 +354,8 @@ static int br_switchdev_vlan_attr_replay(struct net_device *br_dev,
> attr.orig_dev = br_dev;
>
> vg = br_vlan_group(br);
> + if (!vg)
> + return 0;
>
> list_for_each_entry(v, &vg->vlan_list, vlist) {
> if (v->msti) {
Good catch.
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
next prev parent reply other threads:[~2022-04-21 10:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 10:12 [PATCH net-next] net: bridge: switchdev: check br_vlan_group() return value Clément Léger
2022-04-21 10:17 ` Nikolay Aleksandrov [this message]
2022-04-22 22:14 ` Jakub Kicinski
2022-04-22 22:20 ` patchwork-bot+netdevbpf
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=c945ebff-02fe-f2d5-656f-6bdfc46416f1@blackwall.org \
--to=razor@blackwall.org \
--cc=bridge@lists.linux-foundation.org \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=roopa@nvidia.com \
--cc=tobias@waldekranz.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).