]> git.ipfire.org Git - thirdparty/linux.git/commit
ASoC: topology: Check PCM and DAI name strings before use
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Thu, 4 Jun 2026 03:10:58 +0000 (00:10 -0300)
committerMark Brown <broonie@kernel.org>
Thu, 11 Jun 2026 19:47:42 +0000 (20:47 +0100)
commitb7e44d1986d6671342c19b82192189ca5db5dab7
tree4a11d31c113633b88dbd26d87d52c114a8ffb05d
parent890b61d3a8c980ec46d88b9ab1b35e3ddd4f1593
ASoC: topology: Check PCM and DAI name strings before use

Topology objects store several PCM and DAI names in fixed-size UAPI
arrays. Other topology parser paths validate these fields with bounded
strnlen() checks before using them as C strings, but the PCM and DAI
paths still pass some fixed-size arrays directly to strlen(),
devm_kstrdup(), DAI lookup, and diagnostic prints.

A malformed topology blob with a non-NUL-terminated PCM, DAI, or stream
capability name can therefore make the parser read past the end of the
fixed-size field.

Reject unterminated PCM and DAI name fields before consuming them as C
strings.

Fixes: 64527e8a3529 ("ASoC: topology: Add FE DAIs dynamically")
Fixes: acfc7d46cddc ("ASoC: topology: Add FE DAI links dynamically")
Fixes: 0038be9a84dc ("ASoC: topology: Add support for configuring existing BE DAIs")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260604-asoc-topology-check-pcm-dai-names-v1-1-e1b0f6f7c2ce@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c