tcp: annotate data-race around tcp_md5sig_pool_populated
authorEric Dumazet <edumazet@google.com>
Mon, 22 Aug 2022 21:15:28 +0000 (21:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:33 +0000 (12:35 +0200)
commit1663629bc3ffcb2e441457f86dafbc63a1a61c3f
tree1e900a02058203194be4c5227cdeeef104c0d53c
parent7b03296b4f7a4429b372cd869c6ca0ff7e6b3d15
tcp: annotate data-race around tcp_md5sig_pool_populated

[ Upstream commit aacd467c0a576e5e44d2de4205855dc0fe43f6fb ]

tcp_md5sig_pool_populated can be read while another thread
changes its value.

The race has no consequence because allocations
are protected with tcp_md5sig_mutex.

This patch adds READ_ONCE() and WRITE_ONCE() to document
the race and silence KCSAN.

Reported-by: Abhishek Shah <abhishek.shah@columbia.edu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/tcp.c