module_adapter: validate connection count against module capacity#10791
Open
abonislawski wants to merge 1 commit into
Open
module_adapter: validate connection count against module capacity#10791abonislawski wants to merge 1 commit into
abonislawski wants to merge 1 commit into
Conversation
Add a bounds check in module_adapter_prepare() to reject topologies where the actual number of connected sources or sinks exceeds the module-declared capacity (max_sources / max_sinks). Without this check, a misconfigured topology binding more sources than a module supports leads to out-of-bounds writes into the input_buffers or output_buffers arrays allocated for max_sources/max_sinks entries. The audio_stream copy path already validates this (in module_adapter_audio_stream_type_copy), but the raw-data path had no equivalent guard in either prepare or copy. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a capacity validation in module_adapter_prepare() so raw/audio-stream module adapters reject topologies with more connected sources or sinks than the module declares it can handle.
Changes:
- Counts connected sources and sinks during prepare.
- Rejects configurations where those counts exceed
max_sourcesormax_sinks.
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.
Add a bounds check in module_adapter_prepare() to reject topologies where the actual number of connected sources or sinks exceeds the module-declared capacity (max_sources / max_sinks).
Without this check, a misconfigured topology binding more sources than a module supports leads to out-of-bounds writes into the input_buffers or output_buffers arrays allocated for max_sources/max_sinks entries.
The audio_stream copy path already validates this (in module_adapter_audio_stream_type_copy), but the raw-data path had no equivalent guard in either prepare or copy.