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 11:25:45 +0000 (13:25 +0200)
commit0958e487e81bdb5ca658a3b6e72c8252d6e163f9
tree26a6243f526e3d786e17df4df37e3a68d3b6f1f3
parent129ca0db956e1e2483f55d2217756f9258f52737
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