]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp_metrics: annotate data-races around tm->tcpm_net
authorEric Dumazet <edumazet@google.com>
Wed, 2 Aug 2023 13:14:59 +0000 (13:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 13:13:55 +0000 (15:13 +0200)
commit4517782e1bc35d8d974653f6c382bbad56160ed2
tree809f9d500ff81392f66aa70bb0e801f1ab6e3405
parente842a68667d4f406da2571a7527bad74767bc496
tcp_metrics: annotate data-races around tm->tcpm_net

[ Upstream commit d5d986ce42c71a7562d32c4e21e026b0f87befec ]

tm->tcpm_net can be read or written locklessly.

Instead of changing write_pnet() and read_pnet() and potentially
hurt performance, add the needed READ_ONCE()/WRITE_ONCE()
in tm_net() and tcpm_new().

Fixes: 849e8a0ca8d5 ("tcp_metrics: Add a field tcpm_net and verify it matches on lookup")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230802131500.1478140-6-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/tcp_metrics.c