]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit17007ce1fb0246c31ad01ea231c751bb8403cbeb
treedaa03f61c31a8ed06c042415d9aa917d974f55c7
parenta3d27b0308ebabcd299f60715a3e0eb8ff59f07e
tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save.

commit 7b8512603083cf7666210748820e9b22a8977b2a 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: 1cb407385d84 ("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