[PATCH 6.1 038/127] net: add missing READ_ONCE(sk->sk_rcvlowat) annotation

Greg Kroah-Hartman
2023-08-09T10:54:20Z

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit e6d12bdb435d23ff6c1890c852d85408a2f496ee ]

In a prior commit, I forgot to change sk_getsockopt()
when reading sk->sk_rcvlowat locklessly.

Fixes: eac66402d1c3 ("net: annotate sk->sk_rcvlowat lockless reads")
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/core/sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 86e88de1238b1..1b1fe67b94d4f 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1717,7 +1717,7 @@ int sk_getsockopt(struct sock *sk, int level, int optname,
break;

case SO_RCVLOWAT:
- v.val = sk->sk_rcvlowat;
+ v.val = READ_ONCE(sk->sk_rcvlowat);
break;

case SO_SNDLOWAT:
--
2.40.1