mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	phonet: take correct lock to peek at the RX queue
The receive queue is protected by its embedded spin-lock, not the
socket lock, so we need the former lock here (and only that one).
Fixes: 107d0d9b8d ("Phonet: Phonet datagram transport protocol")
Reported-by: Luosili <rootlab@huawei.com>
Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240218081214.4806-1-remi@remlab.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									603ead9658
								
							
						
					
					
						commit
						3b2d9bc4d4
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -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: | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Rémi Denis-Courmont
						Rémi Denis-Courmont