The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net] ppp: annotate lockless queue empty check
@ 2026-08-11  6:02 Qingfang Deng
  2026-08-11  9:41 ` Breno Leitao
  0 siblings, 1 reply; 2+ messages in thread
From: Qingfang Deng @ 2026-08-11  6:02 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Qingfang Deng, Breno Leitao, Norbert Szetei,
	Taegu Ha, linux-ppp, netdev, linux-kernel

ppp_poll() checks whether pf->rq contains a packet without holding the
queue lock. skb_peek() requires appropriate locking or a private queue,
neither of which applies because ppp_input() can enqueue concurrently.

Only queue emptiness is needed, so use skb_queue_empty_lockless()
instead.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
 drivers/net/ppp/ppp_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index e1013621eb1d..1a610a18893b 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -556,7 +556,7 @@ static __poll_t ppp_poll(struct file *file, poll_table *wait)
 		return 0;
 	poll_wait(file, &pf->rwait, wait);
 	mask = EPOLLOUT | EPOLLWRNORM;
-	if (skb_peek(&pf->rq))
+	if (!skb_queue_empty_lockless(&pf->rq))
 		mask |= EPOLLIN | EPOLLRDNORM;
 	if (pf->dead)
 		mask |= EPOLLHUP;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ppp: annotate lockless queue empty check
  2026-08-11  6:02 [PATCH net] ppp: annotate lockless queue empty check Qingfang Deng
@ 2026-08-11  9:41 ` Breno Leitao
  0 siblings, 0 replies; 2+ messages in thread
From: Breno Leitao @ 2026-08-11  9:41 UTC (permalink / raw)
  To: Qingfang Deng
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Norbert Szetei, Taegu Ha, linux-ppp, netdev,
	linux-kernel

On Tue, Aug 11, 2026 at 02:02:29PM +0800, Qingfang Deng wrote:
> ppp_poll() checks whether pf->rq contains a packet without holding the
> queue lock. skb_peek() requires appropriate locking or a private queue,
> neither of which applies because ppp_input() can enqueue concurrently.
> 
> Only queue emptiness is needed, so use skb_queue_empty_lockless()
> instead.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>

Reviewed-by: Breno Leitao <leitao@debian.org.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-11  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11  6:02 [PATCH net] ppp: annotate lockless queue empty check Qingfang Deng
2026-08-11  9:41 ` Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox