Re: [PATCH net] ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work

From: Hangbin Liu
Date: Thu Jan 18 2024 - 04:56:00 EST


On Thu, Jan 18, 2024 at 04:24:52PM +0900, Taehee Yoo wrote:
> > I saw mld_process_v1() also cancel these works when changing to v1 mode.
> > Should we also add lock there?
>
> I think mld_process_v1() doesn't have a problem.
> Because mld_process_v1() is always called under mc_lock by mld_query_work().
>
> mld_query_work()
> mutex_lock(&idev->mc_lock);
> __mld_query_work();
> mld_process_v1();
> mutex_unlock(&idev->mc_lock);

Thanks for this info, then this works for me.

Hangbin