]> www.infradead.org Git - users/willy/linux.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)
committerTakashi Iwai <tiwai@suse.de>
Mon, 5 Aug 2024 13:03:03 +0000 (15:03 +0200)
commit15b7a03205b31bc5623378c190d22b7ff60026f1
tree5c200455693b47ee319ff706404ff0d98c4bdcfe
parent312c04cee408a8448ec8b639fe7f0434017d7161
ALSA: line6: Fix racy access to midibuf

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>
sound/usb/line6/driver.c