]> git.baikalelectronics.ru Git - kernel.git/commit
tcp_metrics: annotate data-races around tm->tcpm_vals[]
authorEric Dumazet <edumazet@google.com>
Wed, 2 Aug 2023 13:14:58 +0000 (13:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 10:08:18 +0000 (12:08 +0200)
commit6dea95d8caff9512fbd91bcf0375c046c98c165b
treee02a67eb3858bbefae471e5bb391a191c6439035
parentfee608e802718649185be76c4478012154a5fe33
tcp_metrics: annotate data-races around tm->tcpm_vals[]

[ Upstream commit 8c4d04f6b443869d25e59822f7cec88d647028a9 ]

tm->tcpm_vals[] values can be read or written locklessly.

Add needed READ_ONCE()/WRITE_ONCE() to document this,
and force use of tcp_metric_get() and tcp_metric_set()

Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/tcp_metrics.c