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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:03:45 +0000 (12:03 +0200)
commit62e721dee8ccf70c7652c8424f6f9fa5874c924d
treedaa03f61c31a8ed06c042415d9aa917d974f55c7
parentaa2ca5b5629dad5c3a238550464c0b731930741d
tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save.

commit ab1ba21b523ab496b1a4a8e396333b24b0a18f9a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_metrics.c