linux-yocto/sound
Jeongjun Park af600e7f55 ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
commit 9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 upstream.

The previous commit 0718a78f6a ("ALSA: usb-audio: Kill timer properly at
removal") patched a UAF issue caused by the error timer.

However, because the error timer kill added in this patch occurs after the
endpoint delete, a race condition to UAF still occurs, albeit rarely.

Additionally, since kill-cleanup for urb is also missing, freed memory can
be accessed in interrupt context related to urb, which can cause UAF.

Therefore, to prevent this, error timer and urb must be killed before
freeing the heap memory.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+f02665daa2abeef4a947@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f02665daa2abeef4a947
Fixes: 0718a78f6a ("ALSA: usb-audio: Kill timer properly at removal")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-06 11:18:47 +02:00
..
ac97
aoa
arm
atmel ALSA: atmel: Replace deprecated strcpy() with strscpy() 2025-05-22 20:35:56 +02:00
core ALSA: timer: fix ida_free call while not allocated 2025-08-28 16:34:49 +02:00
drivers treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
firewire ALSA: firewire-motu: drop EPOLLOUT from poll return values as write is not supported 2025-09-25 11:16:42 +02:00
hda Merge branch 'for-linus' into for-next 2025-05-22 20:34:24 +02:00
i2c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
isa ALSA: ad1816a: Fix potential NULL pointer deref in snd_card_ad1816a_pnp() 2025-07-04 09:04:12 +02:00
mips ALSA: n64: Replace deprecated strcpy() with strscpy() 2025-05-19 17:49:59 +02:00
oss
parisc
pci ALSA: hda/realtek: Add support for ASUS NUC using CS35L41 HDA 2025-10-02 13:48:24 +02:00
pcmcia
ppc
sh treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
soc ASoC: Intel: sof_rt5682: Add HDMI-In capture with rt5682 support for PTL. 2025-10-02 13:48:25 +02:00
sparc ALSA: amd7930: replace strcpy() with strscpy() 2025-05-20 16:07:18 +02:00
spi
synth treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
usb ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free 2025-10-06 11:18:47 +02:00
virtio ALSA: virtio: use snd_kcontrol_chip() 2025-05-08 11:53:34 +02:00
x86 ALSA: intel_hdmi: Fix off-by-one error in __hdmi_lpe_audio_probe() 2025-08-15 16:39:33 +02:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c