ALSA: usb-audio: Fix racy list management in output queue
authorTakashi Iwai <tiwai@suse.de>
Fri, 24 Apr 2020 07:40:16 +0000 (09:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:36 +0000 (17:48 +0200)
commit3b690b5447452c363cbab7daee1c69903b63afa0
tree493ccd04bda65a3f288c6db4a76d56e1513e72f9
parentd288dc74f8cf95cb7ae0aaf245b7128627a49bf3
ALSA: usb-audio: Fix racy list management in output queue

[ Upstream commit 5b6cc38f3f3f37109ce72b60bda215a5f6892c0b ]

The linked list entry from FIFO is peeked at
queue_pending_output_urbs() but the actual element pop-out is
performed outside the spinlock, and it's potentially racy.

Do delete the link at the right place inside the spinlock.

Fixes: 8fdff6a319e7 ("ALSA: snd-usb: implement new endpoint streaming model")
Link: https://lore.kernel.org/r/20200424074016.14301-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/endpoint.c