linux/sound/usb
Jiaming Zhang 736159f7b2 ALSA: usb-audio: Fix NULL pointer deference in try_to_register_card
[ Upstream commit 28412b489b ]

In try_to_register_card(), the return value of usb_ifnum_to_if() is
passed directly to usb_interface_claimed() without a NULL check, which
will lead to a NULL pointer dereference when creating an invalid
USB audio device. Fix this by adding a check to ensure the interface
pointer is valid before passing it to usb_interface_claimed().

Fixes: 39efc9c8a9 ("ALSA: usb-audio: Fix last interface check for registration")
Closes: https://lore.kernel.org/all/CANypQFYtQxHL5ghREs-BujZG413RPJGnO5TH=xjFBKpPts33tA@mail.gmail.com/
Signed-off-by: Jiaming Zhang <r772577952@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-29 14:03:09 +01:00
..
6fire ALSA: 6fire: Release resources at card release 2024-12-14 19:50:59 +01:00
bcd2000 ALSA: bcd2000: Fix a UAF bug on the error path of probing 2022-08-17 14:22:46 +02:00
caiaq ALSA: caiaq: Use snd_card_free_when_closed() at disconnection 2024-12-14 19:50:59 +01:00
hiface module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
line6 ALSA: line6: add hw monitor volume control to POD HD500X 2024-10-17 15:11:36 +02:00
misc ALSA: ua101: fix division by zero at probe 2021-11-18 19:15:54 +01:00
usx2y ALSA: usx2y: validate nrpacks module parameter on probe 2025-03-13 12:51:05 +01:00
card.c ALSA: usb-audio: Fix NULL pointer deference in try_to_register_card 2025-10-29 14:03:09 +01:00
card.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2024-03-15 10:48:19 -04:00
clock.c ALSA: usb-audio: Fix out of bounds reads when finding clock sources 2024-12-14 19:51:11 +01:00
clock.h ALSA: usb-audio: Constify audioformat pointer references 2020-11-23 15:15:36 +01:00
endpoint.c ALSA: usb-audio: Notify xrun for low-latency mode 2024-12-14 19:51:30 +01:00
endpoint.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2024-03-15 10:48:19 -04:00
format.c ALSA: usb-audio: Add second USB ID for Jabra Evolve 65 headset 2025-05-09 09:39:35 +02:00
format.h ALSA: usb: initial USB Audio Device Class 3.0 support 2018-03-21 11:46:33 +01:00
helper.c ALSA: usb-audio: Add snd_usb_get_host_interface() helper 2020-11-23 15:13:47 +01:00
helper.h ALSA: usb-audio: Add snd_usb_get_host_interface() helper 2020-11-23 15:13:47 +01:00
implicit.c ALSA: usb-audio: Add implicit feedback quirk for RODE AI-1 2025-06-27 11:05:21 +01:00
implicit.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2024-03-15 10:48:19 -04:00
Kconfig sound: Fix Kconfig indentation 2019-10-07 03:53:03 +02:00
Makefile ALSA: usb-audio: Factor out the implicit feedback quirk code 2020-11-23 15:17:00 +01:00
media.c ALSA: usb-audio: fix spelling mistakes 2021-07-05 19:33:54 +02:00
media.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
midi.c ALSA: usb-audio: Fix CME quirk for UF series keyboards 2025-05-02 07:43:54 +02:00
midi.h ALSA: usb-audio: generate midi streaming substream names from jack names 2021-03-01 09:21:54 +01:00
mixer.c ALSA: usb: Fix UBSAN warning in parse_audio_unit() 2025-01-09 13:28:29 +01:00
mixer.h ALSA: usb-audio: Add input value sanity checks for standard types 2024-10-17 15:11:27 +02:00
mixer_maps.c ALSA: usb-audio: Rename ALSA kcontrol PCM and PCM1 for the KTMicro sound card 2025-06-27 11:05:34 +01:00
mixer_quirks.c ALSA: usb-audio: Fix build with CONFIG_INPUT=n 2025-10-02 13:39:10 +02:00
mixer_quirks.h ALSA: usb-audio: Initialize Dell Dock playback volumes 2018-05-02 16:02:32 +02:00
mixer_s1810c.c ALSA: usb-audio: fix spelling mistakes 2021-07-05 19:33:54 +02:00
mixer_s1810c.h ALSA: usb-audio: Add support for Presonus Studio 1810c 2020-02-15 09:46:16 +01:00
mixer_scarlett.c ALSA: usb-audio: fix spelling mistakes 2021-07-05 19:33:54 +02:00
mixer_scarlett.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer_scarlett_gen2.c ALSA: scarlett2: Add retry on -EPROTO from scarlett2_usb_tx() 2025-08-28 16:24:31 +02:00
mixer_scarlett_gen2.h ALSA: usb-audio: scarlett2: Improve driver startup messages 2021-05-21 16:22:52 +02:00
mixer_us16x08.c ALSA: usb-audio: US16x08: Initialize array before use 2025-01-09 13:28:46 +01:00
mixer_us16x08.h ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
pcm.c ALSA: usb-audio: Fix possible NULL pointer dereference in snd_usb_pcm_has_fixed_rate() 2024-10-17 15:11:48 +02:00
pcm.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2024-03-15 10:48:19 -04:00
power.c ALSA: usb-audio: More validations of descriptor units 2019-08-22 10:35:59 +02:00
power.h ALSA: usb-audio: Initial Power Domain support 2018-07-31 15:01:22 +02:00
proc.c ALSA: usb-audio: Show sync endpoint information in proc outputs 2020-11-23 15:16:45 +01:00
proc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
quirks-table.h ALSA: usb-audio: Fix Yamaha P-125 Quirk Entry 2024-12-14 19:50:41 +01:00
quirks.c ALSA: usb-audio: Add a quirk for Lenovo Thinkpad Thunderbolt 3 dock 2025-07-10 15:57:34 +02:00
quirks.h ALSA: usb-audio: Register card at the last interface 2022-10-26 12:35:39 +02:00
stream.c ALSA: usb-audio: Fix size validation in convert_chmap_v3() 2025-08-28 16:24:38 +02:00
stream.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usbaudio.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2024-03-15 10:48:19 -04:00
validate.c ALSA: usb-audio: Use correct sub-type for UAC3 feature unit validation 2025-08-28 16:24:38 +02:00