From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Yuyang Huang <yuyanghuang@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Ido Schimmel <idosch@nvidia.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ipv4: igmp: remove multicast group from hash table on device destruction
Date: Wed, 10 Jun 2026 10:52:17 +0200 [thread overview]
Message-ID: <5224a3f8-16e9-4967-9fce-14e1a0fc5205@6wind.com> (raw)
In-Reply-To: <CADXeF1FaYn2sDyM3Kfic5eyP2oQO9uQE_rFbwwRZFrOqyWSJcQ@mail.gmail.com>
Le 10/06/2026 à 10:37, Yuyang Huang a écrit :
> On Wed, Jun 10, 2026 at 4:50 PM Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>>
>> Le 09/06/2026 à 14:26, Yuyang Huang a écrit :
>>> When a device is destroyed under RTNL, ip_mc_destroy_dev() iterates through
>>> the multicast list and calls ip_ma_put() on each membership, scheduling
>>> them for RCU reclamation. However, they are not unlinked from the device's
>>> multicast hash table (mc_hash).
>>>
>>> Since the device remains published in dev->ip_ptr until after
>>> ip_mc_destroy_dev() completes, concurrent RCU readers traversing mc_hash
>>> can still locate and access the multicast group after its refcount is
>>> decremented. If the RCU callback runs and frees the group while a reader is
>>> accessing it, a use-after-free occurs.
>>>
>>> Fix this by unlinking the multicast group from mc_hash using
>>> ip_mc_hash_remove() before scheduling it for reclamation.
>>>
>>> Signed-off-by: Yuyang Huang <yuyanghuang@google.com>
>> A 'Fixes' tag may be useful for backports.
>
> Thanks for the suggestion. Per discussion in the following thread, we
> don't need to add the Fixes tag for a trivial fix.
>
> https://lore.kernel.org/netdev/20260604101728.GA771160@shredder/
I probably misunderstood the commit, but you are talking about a
'use-after-free', which doesn't seem trivial for me.
next prev parent reply other threads:[~2026-06-10 8:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 12:26 Yuyang Huang
2026-06-10 7:50 ` Nicolas Dichtel
2026-06-10 8:37 ` Yuyang Huang
2026-06-10 8:52 ` Nicolas Dichtel [this message]
2026-06-10 10:56 ` Yuyang Huang
2026-06-14 0:29 ` Yuyang Huang
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=5224a3f8-16e9-4967-9fce-14e1a0fc5205@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yuyanghuang@google.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
all inboxes | Powered by JetHome®