]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Fix a data-race around sysctl_tcp_nometrics_save.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 20 Jul 2022 16:50:16 +0000 (09:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 09:59:38 +0000 (11:59 +0200)
commitc03ba45c0e4b89e706b0e38eee5eed5690875c15
tree07f91ab756c2dcdfe7989b55559eabbc699431e8
parentabb7ca34aa9f2e0d5a823b809504b791479428b4
tcp: Fix a data-race around sysctl_tcp_nometrics_save.

commit 14041bfc0132f82b229458a24db12ec05ed99ab1 upstream.

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

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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