net: annotate data-races around sk->sk_reserved_mem
authorEric Dumazet <edumazet@google.com>
Fri, 28 Jul 2023 15:03:08 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 10:08:13 +0000 (12:08 +0200)
commit60d92bc9c0940a8492a025b54224b6f063932736
tree83e5a9d6d376048eb395b51c167e837bc49b50a0
parent9da9ea9b132cbb9a5c4ff3d00214bd7064ca1a9a
net: annotate data-races around sk->sk_reserved_mem

[ Upstream commit fe11fdcb4207907d80cda2e73777465d68131e66 ]

sk_getsockopt() runs locklessly. This means sk->sk_reserved_mem
can be read while other threads are changing its value.

Add missing annotations where they are needed.

Fixes: 2bb2f5fb21b0 ("net: add new socket option SO_RESERVE_MEM")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/sock.c