]> 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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2022 11:21:53 +0000 (12:21 +0100)
commit3e622554ebe19c90eb71ed2911cd78096114679a
tree059c23812023d31f5c1ed5293f27602118174800
parent3865d7f39092c784e1420b5ad43e10bcde45d55e
igmp: Fix data-races around sysctl_igmp_llm_reports.

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