ipv4: Fix data-races around sysctl_ip_dynaddr.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 12 Jul 2022 00:15:32 +0000 (17:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:28 +0000 (21:24 +0200)
commit6b26fb2fe227317f6afdc8ffbdbe7819aecce643
treef57ee595479396715e3023d54a8cdb185f7ad7e3
parent8bcf7339f2cf70ea4461df6ea045d1aadfabfa11
ipv4: Fix data-races around sysctl_ip_dynaddr.

[ Upstream commit e49e4aff7ec19b2d0d0957ee30e93dade57dab9e ]

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

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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>
Documentation/networking/ip-sysctl.rst
net/ipv4/af_inet.c