Commit 0026aefb authored by Kuniyuki Iwashima's avatar Kuniyuki Iwashima Committed by Zheng Zengkai
Browse files

igmp: Fix data-races around sysctl_igmp_llm_reports.

stable inclusion
from stable-v5.10.134
commit 473aad9ad57ff760005377e6f45a2ad4210e08ce
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5ZVR7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=473aad9ad57ff760005377e6f45a2ad4210e08ce



--------------------------------

[ Upstream commit f6da2267 ]

While reading sysctl_igmp_llm_reports, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.

This test can be packed into a helper, so such changes will be in the
follow-up series after net is merged into net-next.

  if (ipv4_is_local_multicast(pmc->multiaddr) &&
      !READ_ONCE(net->ipv4.sysctl_igmp_llm_reports))

Fixes: df2cf4a7 ("IGMP: Inhibit reports for local multicast groups")
Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent e63d0712
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment