]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: SOF: validate probe info element counts
authorYousef Alhouseen <alhouseenyousef@gmail.com>
Sun, 28 Jun 2026 00:03:29 +0000 (02:03 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 1 Jul 2026 12:11:59 +0000 (13:11 +0100)
commit95edf2dbb492f3ea2420111e9c0044c7dec9113c
treeb72f32faeacfe591136ca6e7f53e20e10b49059a
parente782d687d2f5bf8b8113dc48ba22cca4b472c252
ASoC: SOF: validate probe info element counts

Probe information replies contain a firmware-provided element count. IPC3
uses that count to copy an array, then returns the unchecked count to its
caller. A short reply can therefore make the caller walk beyond the copied
array.

IPC4 similarly uses the count both to allocate the destination array and
to walk the reply. On 32-bit systems the allocation size can wrap, while on
all systems an excessive count reads beyond the reply payload.

Validate each count against the actual reply size before copying or
allocating the array, and use kcalloc() for the IPC4 allocation.

Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
Link: https://patch.msgid.link/20260628000329.18606-1-alhouseenyousef@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-client-probes-ipc3.c
sound/soc/sof/sof-client-probes-ipc4.c