linux/sound/usb/6fire
Takashi Iwai 9fe49dbc02 ALSA: usb: 6fire: Avoid embedded URBs
The USB 6fire driver uses URBs embedded in different structs for PCM,
MIDI and communication, and this is basically a buggy implementation
nowadays; since a URB is managed with a refcount, this may lead to a
UAF when the URB is released asynchronously.

For addressing the problem, this patch converts those embedded URBs to
ones that are properly allocated via usb_alloc_urb().  The
pcm_urb.packets[] is gone, as it's allocated by usb_alloc_urb(), hence
it's found in urb.iso_frame_desc[] instead.

The conversions are rather straightforward; each embedded struct urb
is changed to a pointer, and its callers are updated accordingly.
The resource for those structs are released in the common destructor
functions (usb6fire_comm_free(), etc), which are called at both the
init error path and the disconnect.

No functional changes, only compile-tested.

Link: https://lore.kernel.org/20260903130757.0668310a.michal.pecio@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260903160458.1938392-4-tiwai@suse.de
History 2026-09-06 10:01:42 +02:00
..
chip.c ALSA: 6fire: Fix UAF at error handling during probe 2026-07-26 10:02:01 +02:00
chip.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
comm.c ALSA: usb: 6fire: Avoid embedded URBs 2026-09-06 10:01:42 +02:00
comm.h ALSA: usb: 6fire: Avoid embedded URBs 2026-09-06 10:01:42 +02:00
common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
control.c ALSA: 6fire: Use common error handling code in usb6fire_control_init() 2026-06-10 19:47:49 +02:00
control.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
firmware.c ALSA: 6fire: Use auto-cleanup for firmware loading 2026-07-31 12:44:35 +02:00
firmware.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Makefile ALSA: usb: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:53 +02:00
midi.c ALSA: usb: 6fire: Avoid embedded URBs 2026-09-06 10:01:42 +02:00
midi.h ALSA: usb: 6fire: Avoid embedded URBs 2026-09-06 10:01:42 +02:00
pcm.c ALSA: usb: 6fire: Avoid embedded URBs 2026-09-06 10:01:42 +02:00
pcm.h ALSA: usb: 6fire: Avoid embedded URBs 2026-09-06 10:01:42 +02:00