diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index 880cd7a9fb34..13a38ec8c917 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -461,6 +461,8 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn link_stream = data->link_stream; p = &be->dpcm[substream->stream].hw_params; + if (substream->runtime->state != SNDRV_PCM_STATE_PREPARED) + link_stream->link_prepared = false; if (link_stream->link_prepared) return 0; -- knotmirror 0.0.1 From 6e6aedb1f8767e343707d89651a2051bff28be07 Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Thu, 15 Oct 2026 21:02:39 +0200 Subject: [PATCH 2/3] ASoC: Intel: avs: Verify sizes of configs coming from topology Before operating on the init_config or NHLT-blob entries check whether their sizes are within bounds of the block being parsed. Signed-off-by: Cezary Rojewski Link: https://patch.msgid.link/20261015190240.729793-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown --- sound/soc/intel/avs/topology.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/intel/avs/topology.c b/sound/soc/intel/avs/topology.c index 5d70be63a4a7..3134a331e23f 100644 --- a/sound/soc/intel/avs/topology.c +++ b/sound/soc/intel/avs/topology.c @@ -1720,6 +1720,10 @@ static int avs_tplg_parse_initial_configs(struct snd_soc_component *comp, AVS_TKN_INIT_CONFIG_ID_U32, mod_init_config_parsers, ARRAY_SIZE(mod_init_config_parsers)); + if (ret) + return ret; + if (config->length > block_size) + return -EINVAL; block_size -= esize; @@ -1790,6 +1794,8 @@ static int avs_tplg_parse_nhlt_configs(struct snd_soc_component *comp, /* With tuples parsed, the blob shall be allocated. */ if (!config->blob) return -EINVAL; + if (config->blob->capabilities_size > block_size) + return -EINVAL; /* Consume the raw data and move to the next entry. */ memcpy(config->blob->capabilities, (u8 *)tuples + esize, -- knotmirror 0.0.1 From 05c2975b4267246219e7aead0467626107e204e9 Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Thu, 15 Oct 2026 21:02:40 +0200 Subject: [PATCH 3/3] ASoC: Intel: avs: Prevent module info underflow Typically modules information is first initialized when loading the base AudioDSP base firmware and then expanded when loadable DSP modules are requested by platform-components, see avs_component_load_libraries(). While theoretically not possible in a production scenario, there is no reason to continue the IDAs preparation if an event caused the newly obtained module information to be smaller or equal than the existing information. Fixes: c1a427e8da93 ("ASoC: Intel: avs: Firmware resources management utilities") Signed-off-by: Cezary Rojewski Link: https://patch.msgid.link/20261015190240.729793-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown --- sound/soc/intel/avs/utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/avs/utils.c b/sound/soc/intel/avs/utils.c index ea14ec173855..f19a62e7e8b5 100644 --- a/sound/soc/intel/avs/utils.c +++ b/sound/soc/intel/avs/utils.c @@ -116,9 +116,11 @@ avs_module_ida_alloc(struct avs_dev *adev, struct avs_mods_info *newinfo, bool p int i; if (!purge && oldinfo) { - if (oldinfo->count >= newinfo->count) - dev_warn(adev->dev, "refreshing %d modules info with %d\n", + if (oldinfo->count >= newinfo->count) { + dev_warn(adev->dev, "modules info underflow, old: %d, new: %d\n", oldinfo->count, newinfo->count); + return -EPROTO; + } tocopy_count = oldinfo->count; }