umber-kernel/sound/usb
Takashi Iwai 6af16f1b86 ALSA: usb-audio: Add sanity check for OOB writes at silencing
[ Upstream commit fba2105a157fffcf19825e4eea498346738c9948 ]

At silencing the playback URB packets in the implicit fb mode before
the actual playback, we blindly assume that the received packets fit
with the buffer size.  But when the setup in the capture stream
differs from the playback stream (e.g. due to the USB core limitation
of max packet size), such an inconsistency may lead to OOB writes to
the buffer, resulting in a crash.

For addressing it, add a sanity check of the transfer buffer size at
prepare_silent_urb(), and stop the data copy if the received data
overflows.  Also, report back the transfer error properly from there,
too.

Note that this doesn't fix the root cause of the playback error
itself, but this merely covers the kernel Oops.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221076
Link: https://patch.msgid.link/20260216141209.1849200-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-04 07:20:42 -05:00
..
6fire
bcd2000
caiaq
hiface
line6
misc
qcom
usx2y
Kconfig
Makefile
card.c
card.h
clock.c
clock.h
endpoint.c ALSA: usb-audio: Add sanity check for OOB writes at silencing 2026-03-04 07:20:42 -05:00
endpoint.h
fcp.c
fcp.h
format.c
format.h
helper.c
helper.h
implicit.c
implicit.h
media.c
media.h
midi.c
midi.h
midi2.c
midi2.h
mixer.c ALSA: usb-audio: Fix use-after-free in snd_usb_mixer_free() 2026-01-30 10:32:23 +01:00
mixer.h
mixer_maps.c
mixer_quirks.c ALSA: usb-audio: fix broken logic in snd_audigy2nx_led_update() 2026-02-11 13:41:59 +01:00
mixer_quirks.h
mixer_s1810c.c ALSA: usb-audio: presonus s18xx uses little-endian 2026-03-04 07:19:59 -05:00
mixer_s1810c.h
mixer_scarlett.c
mixer_scarlett.h
mixer_scarlett2.c ALSA: scarlett2: Fix buffer overflow in config retrieval 2026-01-30 10:32:23 +01:00
mixer_scarlett2.h
mixer_us16x08.c
mixer_us16x08.h
pcm.c ALSA: usb-audio: Use the right limit for PCM OOB check 2026-02-11 13:42:01 +01:00
pcm.h
power.c
power.h
proc.c
proc.h
quirks-table.h
quirks.c ALSA: usb-audio: Add iface reset and delay quirk for AB13X USB Audio 2026-03-04 07:20:09 -05:00
quirks.h
stream.c
stream.h
usbaudio.h
validate.c