]> git.baikalelectronics.ru Git - kernel.git/commit
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:22:48 +0000 (13:22 +0200)
commit8314cca0dc2e498ea6f71521ba8ed464a61470af
tree55b40bfe698ddb5c9d5458a68d951e31b3d1f9f4
parentd4a076fe8c2c27631b000095aca26ebbb3075935
tcp: annotate data-race around tcp_md5sig_pool_populated

[ Upstream commit e86d5b98b77db73880ae54e1b5d7ec3a30008060 ]

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