linux/sound/usb
Jiaming Zhang e1e31e0ec8 ALSA: FCP: Fix NULL pointer dereference in interface lookup
A malformed USB device can provide a vendor-specific interface without
any endpoint descriptors. fcp_find_fc_interface() currently selects the
first vendor-specific interface and reads endpoint 0 from it, without
checking whether the interface actually has any endpoints.

When bNumEndpoints is zero, no endpoint array is allocated for the parsed
alternate setting, so get_endpoint(..., 0) yields an invalid endpoint
descriptor pointer. Dereferencing it through usb_endpoint_num() then
triggers a NULL pointer dereference.

Skip vendor-specific interfaces that do not have any endpoints.

Fixes: 46757a3e7d ("ALSA: FCP: Add Focusrite Control Protocol driver")
Reported-by: Jiaming Zhang <r772577952@gmail.com>
Closes: https://lore.kernel.org/lkml/CANypQFb1EHj0xX8bA1WxSOSK-5xca6ZNKzOQcp12=s=puY7VFw@mail.gmail.com/
Signed-off-by: Jiaming Zhang <r772577952@gmail.com>
Link: https://patch.msgid.link/20260625134933.425785-1-r772577952@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-06-26 07:46:59 +02:00
..
6fire ALSA: 6fire: Use common error handling code in usb6fire_control_init() 2026-06-10 19:47:49 +02:00
bcd2000 ALSA: bcd2000: Use guard() for mutex locks 2025-09-01 13:54:06 +02:00
caiaq ALSA: caiaq: bound the length in the EP1 input parsers 2026-06-18 12:37:50 +02:00
hiface Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
line6 ALSA: usb-audio/line6: Add support for POD HD PRO 2026-04-21 10:07:45 +02:00
misc ALSA: ua101: Reject too-short USB descriptors 2026-05-19 08:08:41 +02:00
qcom ALSA: usb-audio: qcom: Free QMI handle 2026-06-25 13:56:21 +02:00
usx2y ALSA: usx2y: Drain pending US-428 pipe-4 output commands 2026-05-19 08:09:36 +02:00
card.c ALSA: usb-audio: Use the new helper for shutdown refcount 2026-06-11 09:34:09 +02:00
card.h ALSA: usb-audio: Optimize the copy of packet sizes for implicit fb handling 2026-02-16 15:13:35 +01:00
clock.c ALSA: usb-audio: add clock quirk for Motu 1248 2026-05-04 17:50:02 +02:00
clock.h
endpoint.c ALSA: usb-audio: add IFB_SILENCE_ON_EMPTY quirk for Behringer Flow 8 2026-05-26 16:28:05 +02:00
endpoint.h ALSA: usb-audio: Remove unused function declaration 2023-08-01 16:56:57 +02:00
fcp.c ALSA: FCP: Fix NULL pointer dereference in interface lookup 2026-06-26 07:46:59 +02:00
fcp.h ALSA: FCP: Add Focusrite Control Protocol driver 2025-01-18 12:00:38 +01:00
format.c ALSA: usb-audio: stop parsing UAC2 rates at MAX_NR_RATES 2026-04-16 10:33:19 +02:00
format.h
helper.c ALSA: usb-audio: Export USB SND APIs for modules 2025-04-11 13:02:30 +02:00
helper.h ALSA: usb-audio: Support multiple control interfaces 2024-08-12 16:17:46 +02:00
implicit.c ALSA: usb-audio: Add implicit feedback quirk for RODE AI-1 2025-06-02 16:50:04 +02:00
implicit.h ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless 2022-12-22 09:13:54 +01:00
Kconfig ALSA:usb:qcom: add AUXILIARY_BUS to Kconfig dependencies 2026-03-18 12:36:39 +01:00
Makefile ALSA: usb-audio: qcom: Introduce QC USB SND offloading support 2025-04-11 13:02:32 +02:00
media.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
media.h
midi.c ALSA: usb-audio: Bound MIDI endpoint descriptor scans 2026-05-07 12:58:09 +02:00
midi.h ALSA: usb-audio: Manage number of rawmidis globally 2023-05-23 12:11:00 +02:00
midi2.c ALSA: usb-audio: Kill MIDI 2.0 URBs before freeing endpoints 2026-06-19 10:49:21 +02:00
midi2.h ALSA: usb-audio: USB MIDI 2.0 UMP support 2023-05-23 12:11:02 +02:00
mixer_maps.c ALSA: usb-audio: Rename ALSA kcontrol PCM and PCM1 for the KTMicro sound card 2025-06-13 10:18:10 +02:00
mixer_quirks.c ALSA: usb-audio: avoid kobject path lookup in DualSense match 2026-06-25 13:52:32 +02: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: add Studio 1824 support 2026-03-09 13:00:57 +01:00
mixer_s1810c.h
mixer_scarlett.c ALSA: usb-audio: Propagate errors in scarlett_ctl_enum_put() 2026-04-27 13:44:48 +02:00
mixer_scarlett.h ALSA: usb-audio: add mixer support for Focusrite Forte 2026-01-27 09:58:50 +01:00
mixer_scarlett2.c Revert "ALSA: scarlett2: Fix 2i2 Gen 4 direct monitor gain on firmware 2417" 2026-05-26 08:00:51 +02:00
mixer_scarlett2.h ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 2023-10-27 11:22:59 +02:00
mixer_us16x08.c ALSA: usb-audio: Update US-16x08 EQ/comp shadow state after successful writes 2026-04-27 13:44:49 +02:00
mixer_us16x08.h
mixer.c ALSA: usb-audio: Add QUIRK_FLAG_MIXER_GET_CUR_BROKEN 2026-05-31 17:48:48 +02:00
mixer.h ALSA: usb-audio: Add QUIRK_FLAG_MIXER_GET_CUR_BROKEN 2026-05-31 17:48:48 +02:00
pcm.c ALSA: usb-audio: Use the right limit for PCM OOB check 2026-01-21 09:22:12 +01:00
pcm.h ALSA: usb-audio: Export USB SND APIs for modules 2025-04-11 13:02:30 +02:00
power.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
power.h ALSA: usb-audio: Support multiple control interfaces 2024-08-12 16:17:46 +02:00
proc.c ALSA: usb-audio: Replace manual mutex/spinlock with guard() 2025-08-12 08:36:17 +02:00
proc.h
quirks-table.h ALSA: usb-audio: Add quirk for YAMAHA CDS3000 2026-06-18 17:48:56 +02:00
quirks.c ALSA: usb-audio: Add quirk flags for SC13A 2026-06-17 11:05:48 +02:00
quirks.h ALSA: usb-audio: improve module param quirk_flags 2025-09-28 08:35:29 +02:00
stream.c ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3() 2026-04-28 08:14:21 +02:00
stream.h ALSA: usb-audio: Fix potential leak of pd at parsing UAC3 streams 2026-04-28 08:13:50 +02:00
usbaudio.h ALSA: usb-audio: Use the new helper for shutdown refcount 2026-06-11 09:34:09 +02:00
validate.c ALSA: usb-audio: Use correct version for UAC3 header validation 2026-02-26 07:37:29 +01:00