linux/sound/firewire/dice
Junrui Luo c0a1fe1902 ALSA: dice: fix buffer overflow in detect_stream_formats()
commit 324f3e03e8 upstream.

The function detect_stream_formats() reads the stream_count value directly
from a FireWire device without validating it. This can lead to
out-of-bounds writes when a malicious device provides a stream_count value
greater than MAX_STREAMS.

Fix by applying the same validation to both TX and RX stream counts in
detect_stream_formats().

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: 58579c056c ("ALSA: dice: use extended protocol to detect available stream formats")
Cc: stable@vger.kernel.org
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881B043FC68B4C0DA40B73DAFDCA@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-12-18 13:55:23 +01:00
..
dice-alesis.c ALSA: dice: fix stream format at middle sampling rate for Alesis iO 26 2021-05-14 09:40:15 +02:00
dice-extension.c ALSA: dice: fix buffer overflow in detect_stream_formats() 2025-12-18 13:55:23 +01:00
dice-focusrite.c ALSA: dice: Remove left-over license text 2022-12-01 07:50:59 +01:00
dice-harman.c ALSA: firewire: Remove some left-over license text in sound/firewire 2022-09-27 08:42:18 +02:00
dice-hwdep.c ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
dice-interface.h ALSA: dice: improve support for ancient firmware for DICE 2018-04-24 17:18:59 +02:00
dice-midi.c ALSA: firewire: Fix -Wformat-truncation warning for MIDI stream names 2023-09-15 13:22:06 +02:00
dice-mytek.c ALSA: dice: add stream format parameters for Mytek devices 2018-05-18 08:53:51 +02:00
dice-pcm.c ALSA: firewire: use nonatomic PCM operation 2024-09-04 21:51:54 +09:00
dice-presonus.c ALSA: firewire: Remove some left-over license text in sound/firewire 2022-09-27 08:42:18 +02:00
dice-proc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345 2019-06-05 17:37:08 +02:00
dice-stream.c ALSA: dice: fix regression for Lexicon I-ONIX FW810S 2022-11-30 16:15:02 +01:00
dice-tcelectronic.c ALSA: dice: fix stream format for TC Electronic Konnekt Live at high sampling transfer frequency 2021-05-18 08:57:54 +02:00
dice-transaction.c ALSA: dice: wait just for NOTIFY_CLOCK_ACCEPTED after GLOBAL_CLOCK_SELECT operation 2021-06-01 18:36:18 +02:00
dice-weiss.c ALSA: dice: add stream format parameters for Weiss devices 2023-08-10 10:10:34 +02:00
dice.c ALSA: dice: add stream format parameters for Weiss devices 2023-08-10 10:10:34 +02:00
dice.h ALSA: dice: add stream format parameters for Weiss devices 2023-08-10 10:10:34 +02:00
Makefile ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00