]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: dice: fix buffer overflow in detect_stream_formats()
authorJunrui Luo <moonafterrain@outlook.com>
Fri, 28 Nov 2025 04:06:31 +0000 (12:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:40 +0000 (13:09 +0100)
commit3cf854cec0eb371da47ff5fe56eab189d7fa623a
treec4553d5462ee235b542516f1818d2cba1dedc176
parentce205e4807993c9ee60e9715b778d4f377e1b941
ALSA: dice: fix buffer overflow in detect_stream_formats()

commit 324f3e03e8a85931ce0880654e3c3eb38b0f0bba 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: 58579c056c1c ("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>
sound/firewire/dice/dice-extension.c