mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 19:13:03 -04:00
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. Cc: stable+noautosel@kernel.org # race annotation Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev> Reviewed-by: Breno Leitao <leitao@debian.org. Link: https://patch.msgid.link/20260811060236.322284-1-qingfang.deng@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
ac155a2675
commit
095887cb96
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user