Skip to content

Commit 13dd43f

Browse files
committed
igo_nr: validate config blob size before copy
A new configuration blob was copied into the component state as a fixed-size structure without checking the blob was large enough, reading past the allocation for a short blob. Request the blob size and reject one smaller than the configuration structure. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 7c113eb commit 13dd43f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/audio/igo_nr/igo_nr.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,13 +720,20 @@ static void igo_nr_print_config(struct processing_module *mod)
720720
static void igo_nr_set_igo_params(struct processing_module *mod)
721721
{
722722
struct comp_data *cd = module_get_private_data(mod);
723-
struct sof_igo_nr_config *p_config = comp_get_data_blob(cd->model_handler, NULL, NULL);
723+
size_t config_size = 0;
724+
struct sof_igo_nr_config *p_config = comp_get_data_blob(cd->model_handler,
725+
&config_size, NULL);
724726
struct comp_dev *dev = mod->dev;
725727

726728
comp_info(dev, "entry");
727729
igo_nr_check_config_validity(dev, cd);
728730

729731
if (p_config) {
732+
if (config_size < sizeof(cd->config)) {
733+
comp_err(dev, "New config too small: %zu < %zu",
734+
config_size, sizeof(cd->config));
735+
return;
736+
}
730737
comp_info(dev, "New config detected.");
731738
cd->config = *p_config;
732739
igo_nr_print_config(mod);

0 commit comments

Comments
 (0)