]> git.hungrycats.org Git - linux/commit
phonet/pep: fix racy skb_queue_empty() use
authorRémi Denis-Courmont <courmisch@gmail.com>
Sun, 18 Feb 2024 08:12:14 +0000 (10:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:26:38 +0000 (13:26 +0100)
commit9d5523e065b568e79dfaa2ea1085a5bcf74baf78
treefed91fbe76f56c26e5cbef14a816264fbd833a0e
parentf556a352fdb2489d50f1231f58b6dfbadb4e3756
phonet/pep: fix racy skb_queue_empty() use

[ Upstream commit 7d2a894d7f487dcb894df023e9d3014cf5b93fe5 ]

The receive queues are protected by their respective spin-lock, not
the socket lock. This could lead to skb_peek() unexpectedly
returning NULL or a pointer to an already dequeued socket buffer.

Fixes: 9641458d3ec4 ("Phonet: Pipe End Point for Phonet Pipes protocol")
Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com>
Link: https://lore.kernel.org/r/20240218081214.4806-2-remi@remlab.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/phonet/pep.c