]> git.hungrycats.org Git - linux/commit
ASoC: SOF: validate topology volume range before allocation
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Fri, 14 Aug 2026 08:12:38 +0000 (16:12 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 14 Aug 2026 14:22:55 +0000 (15:22 +0100)
commita698e4a60fa54268a38f4e66378851a196cb139b
tree516ab95ed50d171e641e3f5983ab497bfbbc1ed4
parentac47e22fcfcb62ff6b373cbca5139e7141ed33f2
ASoC: SOF: validate topology volume range before allocation

SOF treats the topology mixer min and max values as non-negative indices
into its volume table. It stores them in signed fields, allocates max + 1
entries through an int argument, and later indexes the table with the
stored range.

An inverted range is invalid, while a maximum at or above INT_MAX cannot
be represented safely after the increment or in the signed fields.
Validate the complete range before storing it or allocating the table.

Fixes: 311ce4fe7637 ("ASoC: SOF: Add support for loading topologies")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20260814081238.25434-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/topology.c