Netdev List
 help / color / mirror / Atom feed
From: Jun Yang <littleddfu@gmail.com>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Jun Yang <junvyyang@tencent.com>,
	Ido Schimmel <idosch@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	stable@vger.kernel.org, TencentOS Corvus AI <corvus@tencent.com>,
	bridge@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: bridge: mcast: don't truncate the port group walk on teardown
Date: Tue, 25 Aug 2026 18:19:51 +0800	[thread overview]
Message-ID: <20260825101954.3799675-1-junvyyang@tencent.com> (raw)
In-Reply-To: <19b05984-d67c-4c30-aec6-ee8e8be554d9@blackwall.org>

On 12/08/2026 15:21, Nikolay Aleksandrov wrote:
>> +	/* use _rcu to preserve the next pointer because it might be in use */
>> +	hlist_del_init_rcu(&pg->mglist);
> Just to be clear - I'd expand the comment to include why it is safe to do
> so and under what conditions (multicast_lock held)

Thanks Nik, that is much nicer than the restart/checks dance.
hlist_del_init_rcu() works - the UAF splat is gone (7.2 + KASAN).

Before I spin anything: would you like me to send a v2 with your suggestion,
or will you fold it into the open-coded-list cleanup you mentioned? It is a
UAF with a Fixes/stable tag, so a minimal v2 now may be the easier backport,
but I am happy to leave it to your series.

If you do want the v2, here is the expanded comment I would use:

	/* Keep ->next (held under multicast_lock, freed later by the GC work):
	 * a port->mglist teardown walk may have latched this node as its next,
	 * and deleting other groups of the same port must not truncate it.
	 */

Thanks,
Jun

  reply	other threads:[~2026-08-25 10:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 11:34 [PATCH] net: bridge: mcast: don't truncate the port group walk on teardown Jun Yang
2026-08-12 12:17 ` Nikolay Aleksandrov
2026-08-12 12:21   ` Nikolay Aleksandrov
2026-08-25 10:19     ` Jun Yang [this message]
2026-08-25 10:23       ` Nikolay Aleksandrov

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=20260825101954.3799675-1-junvyyang@tencent.com \
    --to=littleddfu@gmail.com \
    --cc=bridge@lists.linux.dev \
    --cc=corvus@tencent.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=junvyyang@tencent.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=stable@vger.kernel.org \
    /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