Skip to content

audio: igo_nr: bound host active_channel_idx before adopting config#10913

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
abonislawski:fix/igo-config
Jun 17, 2026
Merged

audio: igo_nr: bound host active_channel_idx before adopting config#10913
lgirdwood merged 1 commit into
thesofproject:mainfrom
abonislawski:fix/igo-config

Conversation

@abonislawski

Copy link
Copy Markdown
Member

Adopt the blob only when igo_nr_check_config_validity() passes so a host index past process_enable[] cannot reach prepare/process.

Adopt the blob only when igo_nr_check_config_validity() passes
so a host index past process_enable[] cannot reach prepare/process.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copilot AI review requested due to automatic review settings June 15, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent unsafe adoption of a host-provided igo_nr configuration blob by only applying it when igo_nr_check_config_validity() succeeds, so an out-of-range active_channel_idx cannot propagate into runtime processing.

Changes:

  • Gate cd->config = *p_config; behind a config-validity check in igo_nr_set_igo_params().
  • Avoid applying new runtime config when the blob fails validation.
Comments suppressed due to low confidence (1)

src/audio/igo_nr/igo_nr.c:728

  • igo_nr_check_config_validity() calls comp_get_data_blob() internally. In this function we already called comp_get_data_blob() to get p_config, then call the validator which may read/consume/swap the blob again. If another host update lands between these two calls, the validity check could apply to a different blob than the one copied into cd->config (TOCTOU), reintroducing the out-of-bounds risk this change is trying to prevent. Validate the already-fetched p_config directly (or refactor the validator to take a config pointer) to avoid the double-blob access.
	/* Adopt the host blob only when new config is valid */
	if (p_config && igo_nr_check_config_validity(dev, cd) == 0) {
		comp_info(dev, "New config detected.");
		cd->config = *p_config;
		igo_nr_print_config(mod);
	}

@lgirdwood

Copy link
Copy Markdown
Member

@lrudyX good to merge ?

@lrudyX

lrudyX commented Jun 17, 2026

Copy link
Copy Markdown

@lrudyX good to merge ?
There is one test failing (test error), caused by QB environment (too long path). This can be ignored.

@lgirdwood lgirdwood merged commit 04d0187 into thesofproject:main Jun 17, 2026
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants