icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 12 Jul 2022 00:15:25 +0000 (17:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:27 +0000 (21:24 +0200)
commit44021c2929cf5f6afb10c606cacde4256cf03205
treed1ab0decb89ef9fda3a84c8cf53fe1fa8915a1ad
parentcce955efa0ab81f7fb72e22beed372054c86005c
icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.

[ Upstream commit b04f9b7e85c7d7aecbada620e8759a662af068d3 ]

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

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>
net/ipv4/icmp.c
net/ipv4/sysctl_net_ipv4.c