tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 20 Jul 2022 16:50:17 +0000 (09:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Jul 2022 11:06:17 +0000 (12:06 +0100)
commitab1ba21b523ab496b1a4a8e396333b24b0a18f9a
tree4d454799a04c360beb15452bb5f1f0a1dea08b8e
parent8499a2454d9e8a55ce616ede9f9580f36fd5b0f3
tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save.

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

Fixes: 65e6d90168f3 ("net-tcp: Disable TCP ssthresh metrics cache by default")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_metrics.c