netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <razor@blackwall.org>
To: netdev@vger.kernel.org
Cc: tobias@waldekranz.com, kuba@kernel.org, roopa@nvidia.com,
	bridge@lists.linux.dev, edumazet@google.com, pabeni@redhat.com,
	horms@kernel.org, Nikolay Aleksandrov <razor@blackwall.org>,
	syzbot+9bbe2de1bc9d470eb5fe@syzkaller.appspotmail.com
Subject: [PATCH net 2/2] net: bridge: mst: fix suspicious rcu usage in br_mst_set_state
Date: Sun,  9 Jun 2024 13:36:54 +0300	[thread overview]
Message-ID: <20240609103654.914987-3-razor@blackwall.org> (raw)
In-Reply-To: <20240609103654.914987-1-razor@blackwall.org>

I converted br_mst_set_state to RCU to avoid a vlan use-after-free
but forgot to change the vlan group dereference helper. Switch to vlan
group RCU deref helper to fix the suspicious rcu usage warning.

Fixes: 3a7c1661ae13 ("net: bridge: mst: fix vlan use-after-free")
Reported-by: syzbot+9bbe2de1bc9d470eb5fe@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9bbe2de1bc9d470eb5fe
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
---
 net/bridge/br_mst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_mst.c b/net/bridge/br_mst.c
index 1de72816b0fb..1820f09ff59c 100644
--- a/net/bridge/br_mst.c
+++ b/net/bridge/br_mst.c
@@ -102,7 +102,7 @@ int br_mst_set_state(struct net_bridge_port *p, u16 msti, u8 state,
 	int err = 0;
 
 	rcu_read_lock();
-	vg = nbp_vlan_group(p);
+	vg = nbp_vlan_group_rcu(p);
 	if (!vg)
 		goto out;
 
-- 
2.45.1


  parent reply	other threads:[~2024-06-09 10:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-09 10:36 [PATCH net 0/2] net: bridge: mst: fix suspicious rcu usage warning Nikolay Aleksandrov
2024-06-09 10:36 ` [PATCH net 1/2] net: bridge: mst: pass vlan group directly to br_mst_vlan_set_state Nikolay Aleksandrov
2024-06-09 10:36 ` Nikolay Aleksandrov [this message]
2024-06-13  2:00 ` [PATCH net 0/2] net: bridge: mst: fix suspicious rcu usage warning 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=20240609103654.914987-3-razor@blackwall.org \
    --to=razor@blackwall.org \
    --cc=bridge@lists.linux.dev \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roopa@nvidia.com \
    --cc=syzbot+9bbe2de1bc9d470eb5fe@syzkaller.appspotmail.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).