Re: [PATCH net-next 2/2] ipv6: mcast: annotate igmp6 timer expiry race
From: Yuyang Huang
Date: Tue Jun 09 2026 - 04:07:12 EST
On Tue, Jun 9, 2026 at 4:45 PM Ido Schimmel <idosch@xxxxxxxxxx> wrote:
>
> On Fri, Jun 05, 2026 at 11:57:59PM +0900, Yuyang Huang wrote:
> > /proc/net/igmp6 walks IPv6 multicast memberships under RCU and reads
> > mca_work.timer.expires to print the remaining multicast timer. The
> > delayed-work timer can be updated concurrently.
> >
> > Annotate the intentional lockless procfs snapshot with READ_ONCE().
> >
> > Signed-off-by: Yuyang Huang <sigefriedhyy@xxxxxxxxx>
> > ---
> > net/ipv6/mcast.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> > index bd3972730aa0..184e57469086 100644
> > --- a/net/ipv6/mcast.c
> > +++ b/net/ipv6/mcast.c
> > @@ -2983,6 +2983,7 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v)
> > {
> > struct ifmcaddr6 *im = (struct ifmcaddr6 *)v;
> > struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq);
> > + unsigned long expires = READ_ONCE(im->mca_work.timer.expires);
> > unsigned int mca_flags = READ_ONCE(im->mca_flags);
>
> The comment from Sashiko about inverting the order looks valid. In the write
> path, the MAF_TIMER_RUNNING flag is always set after modifying the timer:
Thanks for the comment, I will fix this in patch v2.