net: mark racy access on sk->sk_rcvbuf
authorlinke li <lilinke99@qq.com>
Thu, 21 Mar 2024 08:44:10 +0000 (16:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:50:52 +0000 (11:50 +0200)
commitc259a4102c844476329f3d08a6e5b19fb7373aad
tree42e28012163cc93f105aa430f5a81ceeeb437671
parent5490a385b48dc403005c5cd9337f49f4f506517e
net: mark racy access on sk->sk_rcvbuf

[ Upstream commit c2deb2e971f5d9aca941ef13ee05566979e337a4 ]

sk->sk_rcvbuf in __sock_queue_rcv_skb() and __sk_receive_skb() can be
changed by other threads. Mark this as benign using READ_ONCE().

This patch is aimed at reducing the number of benign races reported by
KCSAN in order to focus future debugging effort on harmful races.

Signed-off-by: linke li <lilinke99@qq.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/sock.c