]> git.ipfire.org Git - thirdparty/kernel/stable.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 13:13:55 +0000 (15:13 +0200)
commite842a68667d4f406da2571a7527bad74767bc496
tree871fe2ac1965894cfa60e100d1c4e85172f1387f
parentd3184bea4ace15f893a59fbfeaf3ef1e614f0bd0
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