]> 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 10:03:44 +0000 (12:03 +0200)
commita3d27b0308ebabcd299f60715a3e0eb8ff59f07e
tree05dddaff2ce5f78b90d979f6ea706e7f9f924e38
parentc75c4c11dbebd8a1993f60971b6e29d13388aa73
tcp: Fix a data-race around sysctl_tcp_nometrics_save.

commit 87ba594f7debe5939db9c71badd898b3590eee6d 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