linux-stable/sound/usb
Zheyu Ma 1d6a246cf9 ALSA: bcd2000: Fix a UAF bug on the error path of probing
commit ffb2759df7 upstream.

When the driver fails in snd_card_register() at probe time, it will free
the 'bcd2k->midi_out_urb' before killing it, which may cause a UAF bug.

The following log can reveal it:

[   50.727020] BUG: KASAN: use-after-free in bcd2000_input_complete+0x1f1/0x2e0 [snd_bcd2000]
[   50.727623] Read of size 8 at addr ffff88810fab0e88 by task swapper/4/0
[   50.729530] Call Trace:
[   50.732899]  bcd2000_input_complete+0x1f1/0x2e0 [snd_bcd2000]

Fix this by adding usb_kill_urb() before usb_free_urb().

Fixes: b47a22290d ("ALSA: MIDI driver for Behringer BCD2000 USB device")
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220715010515.2087925-1-zheyuma97@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-17 14:40:02 +02:00
..
6fire
bcd2000 ALSA: bcd2000: Fix a UAF bug on the error path of probing 2022-08-17 14:40:02 +02:00
caiaq
hiface
line6
misc ALSA: ua101: fix division by zero at probe 2021-10-27 08:23:30 +02:00
usx2y ALSA: Fix some typo 2021-12-06 10:04:05 +01:00
Kconfig
Makefile
card.c ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
card.h
clock.c ALSA: usb-audio: Optimize TEAC clock quirk 2022-06-06 08:49:00 +02:00
clock.h
endpoint.c
endpoint.h
format.c ALSA: usb-audio: Drop superfluous '0' in Presonus Studio 1810c's ID 2021-12-02 09:39:04 +01:00
format.h
helper.c
helper.h
implicit.c ALSA: usb-audio: Move generic implicit fb quirk entries into quirks.c 2022-06-09 10:29:49 +02:00
implicit.h
media.c
media.h
midi.c ALSA: usb-audio: Cancel pending work at closing a MIDI substream 2022-06-09 10:29:27 +02:00
midi.h
mixer.c ALSA: usb-audio: Don't abort resume upon errors 2022-02-14 13:57:51 +01:00
mixer.h ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
mixer_maps.c ALSA: usb-audio: add mapping for MSI MAG X570S Torpedo MAX. 2022-04-19 09:02:33 +02:00
mixer_quirks.c ALSA: usb-audio: Add mute TLV for playback volumes on RODE NT-USB 2022-03-12 08:50:43 +01:00
mixer_quirks.h ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
mixer_s1810c.c ALSA: usb-audio: remove redundant assignment to variable c 2022-02-08 08:21:32 +01:00
mixer_s1810c.h
mixer_scarlett.c
mixer_scarlett.h
mixer_scarlett_gen2.c ALSA: scarlett2: Add support for the internal "standalone" switch 2022-03-08 10:05:48 +01:00
mixer_scarlett_gen2.h
mixer_us16x08.c
mixer_us16x08.h
pcm.c ALSA: usb-audio: Set up (implicit) sync for Saffire 6 2022-06-14 18:45:16 +02:00
pcm.h
power.c
power.h ALSA: usb-audio: Drop CONFIG_PM ifdefs 2021-12-06 10:19:40 +01:00
proc.c
proc.h
quirks-table.h ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) 2022-07-22 10:21:55 +02:00
quirks.c ALSA: usb-audio: Add quirk for Behringer UMC202HD 2022-08-17 14:40:02 +02:00
quirks.h
stream.c
stream.h
usbaudio.h ALSA: usb-audio: Add quirk bits for enabling/disabling generic implicit fb 2022-06-09 10:29:49 +02:00
validate.c