tcp: Fix data-races around sk_pacing_rate.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 22 Jul 2022 18:21:59 +0000 (11:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:03:51 +0000 (12:03 +0200)
commita610feb170bfb381c090620d30d7ee72505ce001
treecf3d61deacec0316cf36ad06997e8779117674af
parentb01b4f5b45ff251190be0816e0f83c527e6c179f
tcp: Fix data-races around sk_pacing_rate.

[ Upstream commit 59bf6c65a09fff74215517aecffbbdcd67df76e3 ]

While reading sysctl_tcp_pacing_(ss|ca)_ratio, they can be changed
concurrently.  Thus, we need to add READ_ONCE() to their readers.

Fixes: 43e122b014c9 ("tcp: refine pacing rate determination")
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/tcp_input.c