net: annotate data-races around sk->sk_forward_alloc
authorEric Dumazet <edumazet@google.com>
Thu, 31 Aug 2023 13:52:09 +0000 (13:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:28:01 +0000 (12:28 +0200)
commit787c5829681b14903ae507853994860caed00718
tree8188789b5693faa7182bac60d9508a3e57db44b3
parentf1175881ddd91db46648c28eec05628e30e14c65
net: annotate data-races around sk->sk_forward_alloc

[ Upstream commit 5e6300e7b3a4ab5b72a82079753868e91fbf9efc ]

Every time sk->sk_forward_alloc is read locklessly,
add a READ_ONCE().

Add sk_forward_alloc_add() helper to centralize updates,
to reduce number of WRITE_ONCE().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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>
include/net/sock.h
net/core/sock.c
net/ipv4/tcp_output.c
net/ipv4/udp.c
net/mptcp/protocol.c