audio: igo_nr: bound host active_channel_idx before adopting config#10913
Open
abonislawski wants to merge 1 commit into
Open
audio: igo_nr: bound host active_channel_idx before adopting config#10913abonislawski wants to merge 1 commit into
abonislawski wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
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 inigo_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()callscomp_get_data_blob()internally. In this function we already calledcomp_get_data_blob()to getp_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 intocd->config(TOCTOU), reintroducing the out-of-bounds risk this change is trying to prevent. Validate the already-fetchedp_configdirectly (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
approved these changes
Jun 15, 2026
singalsu
approved these changes
Jun 15, 2026
Member
|
@lrudyX good to merge ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopt the blob only when igo_nr_check_config_validity() passes so a host index past process_enable[] cannot reach prepare/process.