]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: line6: Fix racy access to midibuf
authorTakashi Iwai <tiwai@suse.de>
Mon, 5 Aug 2024 13:01:28 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:26 +0000 (15:34 +0200)
commit51d87f11dd199bbc6a85982b088ff27bde53b48a
treec4e6351b838759568252fc55275b9f6b224defbb
parent1ae918806c220ffe04737c6368261699d5202acb
ALSA: line6: Fix racy access to midibuf

commit 15b7a03205b31bc5623378c190d22b7ff60026f1 upstream.

There can be concurrent accesses to line6 midibuf from both the URB
completion callback and the rawmidi API access.  This could be a cause
of KMSAN warning triggered by syzkaller below (so put as reported-by
here).

This patch protects the midibuf call of the former code path with a
spinlock for avoiding the possible races.

Reported-by: syzbot+78eccfb8b3c9a85fc6c5@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/00000000000000949c061df288c5@google.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240805130129.10872-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/line6/driver.c