[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240210125054.71391-1-remi@remlab.net>
Date: Sat, 10 Feb 2024 14:50:53 +0200
From: Rémi Denis-Courmont <remi@...lab.net>
To: courmisch@...il.com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] phonet: take correct lock to peek at the RX queue
From: Rémi Denis-Courmont <courmisch@...il.com>
Reported-by: Luosili <rootlab@...wei.com>
Signed-off-by: Rémi Denis-Courmont <courmisch@...il.com>
---
net/phonet/datagram.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c
index 3aa50dc7535b..976fe250b509 100644
--- a/net/phonet/datagram.c
+++ b/net/phonet/datagram.c
@@ -34,10 +34,10 @@ static int pn_ioctl(struct sock *sk, int cmd, int *karg)
switch (cmd) {
case SIOCINQ:
- lock_sock(sk);
+ spin_lock_bh(&sk->sk_receive_queue.lock);
skb = skb_peek(&sk->sk_receive_queue);
*karg = skb ? skb->len : 0;
- release_sock(sk);
+ spin_unlock_bh(&sk->sk_receive_queue.lock);
return 0;
case SIOCPNADDRESOURCE:
--
2.43.0
Powered by blists - more mailing lists