summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-07-11 17:15:23 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-21 21:24:26 +0200
commitcce955efa0ab81f7fb72e22beed372054c86005c (patch)
treea45362b38a05178b83e18c62c45739d7dd9f7258 /net/ipv6
parenta716a3846c5ff32982ab1cc1ab27592221621958 (diff)
downloadlinux-stable-cce955efa0ab81f7fb72e22beed372054c86005c.tar.gz
linux-stable-cce955efa0ab81f7fb72e22beed372054c86005c.tar.bz2
linux-stable-cce955efa0ab81f7fb72e22beed372054c86005c.zip
icmp: Fix data-races around sysctl_icmp_echo_enable_probe.
[ Upstream commit 4a2f7083cc6cb72dade9a63699ca352fad26d1cd ] While reading sysctl_icmp_echo_enable_probe, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: d329ea5bd884 ("icmp: add response to RFC 8335 PROBE messages") Fixes: 1fd07f33c3ea ("ipv6: ICMPV6: add response to ICMPV6 RFC 8335 PROBE messages") 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>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/icmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 96c5cc0f30ce..716e7717fe8f 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -927,7 +927,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
break;
case ICMPV6_EXT_ECHO_REQUEST:
if (!net->ipv6.sysctl.icmpv6_echo_ignore_all &&
- net->ipv4.sysctl_icmp_echo_enable_probe)
+ READ_ONCE(net->ipv4.sysctl_icmp_echo_enable_probe))
icmpv6_echo_reply(skb);
break;