This is a note to let you know that I've just added the patch titled ASoC: qcom: sdm845: Fix array out of bounds access to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-qcom-sdm845-fix-array-out-of-bounds-access.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 1c668e1c0a0f74472469cd514f40c9012b324c31 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Date: Tue, 9 Mar 2021 14:21:27 +0000 Subject: ASoC: qcom: sdm845: Fix array out of bounds access From: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> commit 1c668e1c0a0f74472469cd514f40c9012b324c31 upstream. Static analysis Coverity had detected a potential array out-of-bounds write issue due to the fact that MAX AFE port Id was set to 16 instead of using AFE_PORT_MAX macro. Fix this by properly using AFE_PORT_MAX macro. Fixes: 1b93a8843147 ("ASoC: qcom: sdm845: handle soundwire stream") Reported-by: John Stultz <john.stultz@xxxxxxxxxx> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Link: https://lore.kernel.org/r/20210309142129.14182-2-srinivas.kandagatla@xxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/qcom/sdm845.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -33,12 +33,12 @@ struct sdm845_snd_data { struct snd_soc_jack jack; bool jack_setup; - bool stream_prepared[SLIM_MAX_RX_PORTS]; + bool stream_prepared[AFE_PORT_MAX]; struct snd_soc_card *card; uint32_t pri_mi2s_clk_count; uint32_t sec_mi2s_clk_count; uint32_t quat_tdm_clk_count; - struct sdw_stream_runtime *sruntime[SLIM_MAX_RX_PORTS]; + struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; }; static unsigned int tdm_slot_offset[8] = {0, 4, 8, 12, 16, 20, 24, 28}; Patches currently in stable-queue which might be from srinivas.kandagatla@xxxxxxxxxx are queue-5.11/asoc-codecs-wcd934x-add-a-sanity-check-in-set-channel-map.patch queue-5.11/asoc-qcom-sdm845-fix-array-out-of-range-on-rx-slim-channels.patch queue-5.11/asoc-qcom-sdm845-fix-array-out-of-bounds-access.patch