ppp: annotate lockless queue empty check
Subsystems (3)
PATCH 1/1 ppp: annotate lockless queue empty check
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.
--- drivers/net/ppp/ppp_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ppp/ppp_generic.c +1 -1
@@ -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 ;
Signature · 1 line
2.43.0
Quoted 9 lines · Qingfang Deng
ppp_poll()checks whetherpf->rqcontains a packet without holding the queue lock.skb_peek()requires appropriate locking or a private queue, neither of which applies becauseppp_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 <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 11 Aug 2026 14:02:29 +0800 you wrote:
ppp_poll()checks whetherpf->rqcontains a packet without holding the queue lock.skb_peek()requires appropriate locking or a private queue, neither of which applies becauseppp_input()can enqueue concurrently.Only queue emptiness is needed, so use
skb_queue_empty_lockless()instead.[...]
Here is the summary with links:
- [net] ppp: annotate lockless queue empty check
https://git.kernel.org/netdev/net-next/c/095887cb96a3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html