linux_dsm_epyc7002/sound/usb
Takashi Iwai 9b7e5208a9 ALSA: usb-audio: Fix race against the error recovery URB submission
USB MIDI driver has an error recovery mechanism to resubmit the URB in
the delayed timer handler, and this may race with the standard start /
stop operations.  Although both start and stop operations themselves
don't race with each other due to the umidi->mutex protection, but
this isn't applied to the timer handler.

For fixing this potential race, the following changes are applied:

- Since the timer handler can't use the mutex, we apply the
  umidi->disc_lock protection at each input stream URB submission;
  this also needs to change the GFP flag to GFP_ATOMIC
- Add a check of the URB refcount and skip if already submitted
- Move the timer cancel call at disconnection to the beginning of the
  procedure; this assures the in-flight timer handler is gone properly
  before killing all pending URBs

Reported-by: syzbot+0f4ecfe6a2c322c81728@syzkaller.appspotmail.com
Reported-by: syzbot+5f1d24c49c1d2c427497@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200710160656.16819-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-10 18:07:25 +02:00
..
6fire
bcd2000
caiaq
hiface
line6 ALSA: line6: Sync the pending work cancel at disconnection 2020-07-10 16:29:38 +02:00
misc
usx2y ALSA: Replace zero-length array with flexible-array 2020-05-07 22:30:36 +02:00
card.c ALSA: usb-audio: Manage auto-pm of all bundled interfaces 2020-06-08 19:34:49 +02:00
card.h ALSA: usb-audio: Replace s/frame/packet/ where appropriate 2020-06-30 19:47:02 +02:00
clock.c
clock.h
debug.h
endpoint.c ALSA: usb-audio: Replace s/frame/packet/ where appropriate 2020-06-30 19:47:02 +02:00
endpoint.h ALSA: usb-audio: Improve frames size computation 2020-04-24 08:25:24 +02:00
format.c ALSA: usb-audio: Set 48 kHz rate for Rodecaster 2020-06-15 08:47:05 +02:00
format.h
helper.c
helper.h
Kconfig
Makefile
media.c
media.h
midi.c ALSA: usb-audio: Fix race against the error recovery URB submission 2020-07-10 18:07:25 +02:00
midi.h
mixer_maps.c ALSA: usb-audio: Quirks for Gigabyte TRX40 Aorus Master onboard audio 2020-05-27 08:10:57 +02:00
mixer_quirks.c ALSA: usb-audio: Fix OOB access of mixer element list 2020-06-24 14:24:29 +02:00
mixer_quirks.h
mixer_s1810c.c
mixer_s1810c.h
mixer_scarlett_gen2.c
mixer_scarlett_gen2.h
mixer_scarlett.c
mixer_scarlett.h
mixer_us16x08.c
mixer_us16x08.h
mixer.c ALSA: usb-audio: Fix OOB access of mixer element list 2020-06-24 14:24:29 +02:00
mixer.h ALSA: usb-audio: Fix OOB access of mixer element list 2020-06-24 14:24:29 +02:00
pcm.c ALSA: usb-audio: Add implicit feedback quirk for RTX6001 2020-07-07 11:46:18 +02:00
pcm.h
power.c
power.h
proc.c ALSA: usb-audio: Fix a limit check in proc_dump_substream_formats() 2020-04-22 11:29:15 +02:00
proc.h
quirks-table.h ALSA: usb-audio: add quirk for MacroSilicon MS2109 2020-07-07 10:23:39 +02:00
quirks.c ALSA: usb-audio: add quirk for Samsung USBC Headset (AKG) 2020-06-23 16:13:49 +02:00
quirks.h
stream.c
stream.h
usbaudio.h ALSA: usb-audio: Manage auto-pm of all bundled interfaces 2020-06-08 19:34:49 +02:00
validate.c