]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: firewire-motu: fix buffer overflow in hwdep read for DSP events
authorJunrui Luo <moonafterrain@outlook.com>
Wed, 3 Dec 2025 04:27:03 +0000 (12:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:37 +0000 (14:03 +0100)
commitcdda0d06f8650e33255f79839f188bbece44117c
treec95d4c78c0a5523fdd789bbe1135da9db4e9b19e
parent8fee481ee6c0d1e3ca64d0cabaa2653533d34a23
ALSA: firewire-motu: fix buffer overflow in hwdep read for DSP events

[ Upstream commit 210d77cca3d0494ed30a5c628b20c1d95fa04fb1 ]

The DSP event handling code in hwdep_read() could write more bytes to
the user buffer than requested, when a user provides a buffer smaller
than the event header size (8 bytes).

Fix by using min_t() to clamp the copy size, This ensures we never copy
more than the user requested.

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: 634ec0b2906e ("ALSA: firewire-motu: notify event for parameter change in register DSP model")
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB78810656377E79E58350D951AFD9A@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/firewire/motu/motu-hwdep.c