]> git.baikalelectronics.ru Git - kernel.git/commit
igmp: Fix data-races around sysctl_igmp_qrv.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 15 Jul 2022 17:17:44 +0000 (10:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2022 11:21:54 +0000 (12:21 +0100)
commitfcf4b2e9f44fee628317625d52ae319d7a0ab652
tree4c8bd4448184cb1cff4998270a0d4819b972f15d
parent86bbfd33a48d63b4021d7676864f95b795538f89
igmp: Fix data-races around sysctl_igmp_qrv.

While reading sysctl_igmp_qrv, 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.

  qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv);

Fixes: cf3e06786429 ("ipv4: implement igmp_qrv sysctl to tune igmp robustness variable")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/amt.c
net/ipv4/igmp.c