]> git.baikalelectronics.ru Git - kernel.git/commit
igmp: Fix data-races around sysctl_igmp_llm_reports.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 15 Jul 2022 17:17:41 +0000 (10:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:17 +0000 (17:25 +0200)
commitec972309541cd2c7dcd5eff6eea32a8809379148
treed7fdb665575883b10209574f7c5f08693f92f394
parent3b938d5cf6bc6da6e42cec98824c4cd5be93a986
igmp: Fix data-races around sysctl_igmp_llm_reports.

[ Upstream commit c54e5f5af4fd2bcee82ad215b6e22aa35b8fde48 ]

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: b8c6057b2ed5 ("IGMP: Inhibit reports for local multicast groups")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/igmp.c