plugin: tplg: bound pipeline_list against TPLG_MAX_PCM_PIPELINES#10880
Open
jsarha wants to merge 1 commit into
Open
plugin: tplg: bound pipeline_list against TPLG_MAX_PCM_PIPELINES#10880jsarha wants to merge 1 commit into
jsarha wants to merge 1 commit into
Conversation
plug_prepare_widget() appends each new pipeline referenced by a PCM into the fixed-size pipeline_list->pipelines[] array: pipeline_list->pipelines[pipeline_list->count] = comp_info->pipe_info; pipeline_list->count++; The array has only TPLG_MAX_PCM_PIPELINES entries, but the number of pipelines bound to a PCM is dictated by the topology graph, which comes from the .tplg file loaded by the SOF ALSA plugin. With no upper-bound check, a topology that binds more than TPLG_MAX_PCM_PIPELINES pipelines to a single PCM writes past the end of the array. Reject the store with -EINVAL once the list is full, before writing past the end of the array. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the SOF ALSA plugin topology handling by preventing an out-of-bounds write when accumulating pipelines bound to a single PCM, where the pipeline count is dictated by the externally-provided .tplg graph.
Changes:
- Add an upper-bound check against
TPLG_MAX_PCM_PIPELINESbefore appending topipeline_list->pipelines[]. - Emit a clear error and reject the topology processing path with
-EINVALwhen the per-PCM pipeline list is full.
kv2019i
approved these changes
Jun 12, 2026
tmleman
approved these changes
Jun 12, 2026
abonislawski
approved these changes
Jun 12, 2026
lgirdwood
approved these changes
Jun 12, 2026
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.
plug_prepare_widget() appends each new pipeline referenced by a PCM into the fixed-size pipeline_list->pipelines[] array:
The array has only TPLG_MAX_PCM_PIPELINES entries, but the number of pipelines bound to a PCM is dictated by the topology graph, which comes from the .tplg file loaded by the SOF ALSA plugin. With no upper-bound check, a topology that binds more than TPLG_MAX_PCM_PIPELINES pipelines to a single PCM writes past the end of the array.
Reject the store with -EINVAL once the list is full, before writing past the end of the array.