]> git.ipfire.org Git - thirdparty/linux.git/commit
ASoC: qcom: common: validate cpu dai id during parsing
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Thu, 2 Apr 2026 08:11:12 +0000 (08:11 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 2 Apr 2026 15:33:43 +0000 (16:33 +0100)
commitd49ee8faefecd4d2eb5c6c9f419f4db9488d68aa
tree61f61917cddc1e3b01e64e8d3b04ffc250ed852d
parente46957f27c6004f3ab5ec456f4e848950364ebc1
ASoC: qcom: common: validate cpu dai id during parsing

lpass ports numbers have been added but the afe/apm driver never got
updated with new max port value that it uses to store dai specific data.
There are more than one places these values are cached and always become
out of sync.

This will result in array out of bounds and weird driver behaviour.

To catch such issues, first add a single place where we can define max
port and second add a check in common parsing code which can error
out before corrupting the memory with out of bounds array access.

This should help both avoid and catch these type of mistakes in future.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260402081118.348071-8-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/common.c
sound/soc/qcom/common.h
sound/soc/qcom/lpass.h
sound/soc/qcom/qdsp6/q6afe.h
sound/soc/qcom/qdsp6/q6apm.h