From: Ido Schimmel <idosch@nvidia.com>
To: Minhong He <heminhong@kylinos.cn>
Cc: dsahern@kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
ap420073@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] ipv6: mld: use ma_put() after canceling mca delayed work
Date: Mon, 27 Jul 2026 15:54:43 +0300 [thread overview]
Message-ID: <20260727125443.GA623641@shredder> (raw)
In-Reply-To: <20260727094107.168272-1-heminhong@kylinos.cn>
On Mon, Jul 27, 2026 at 05:41:07PM +0800, Minhong He wrote:
> When cancel_delayed_work() succeeds, MLD drops the work reference with
> refcount_dec(). Unlike ma_put(), that does not free the ifmcaddr6 when
> the count reaches zero.
>
> Use ma_put() on stop paths. On restart paths, re-arm the delayed work
> before dropping the old reference, matching the ordering used for IPv4
> IGMP timer updates.
>
> Similar to commit 3546deaa0c30 ("ipv4: igmp: Fix potential memory leaks
> in igmp_mod_timer() and igmp_stop_timer()").
In IPv4 the readers grab the multicast group from in_dev->mc_list using
RCU so they could race with the removal of the group from the list. In
IPv6, AFAICT, the readers iterate over the list using the idev->mc_lock
mutex, so I don't see how the same race can happen there.
prev parent reply other threads:[~2026-07-27 12:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 9:41 [PATCH net] ipv6: mld: use ma_put() after canceling mca delayed work Minhong He
2026-07-27 12:54 ` Ido Schimmel [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=20260727125443.GA623641@shredder \
--to=idosch@nvidia.com \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=heminhong@kylinos.cn \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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