Commit b08c3ce
Jyri Sarha
plugin: tplg: bound pipeline_list against TPLG_MAX_PCM_PIPELINES
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>1 parent 3f7738d commit b08c3ce
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
999 | 999 | | |
1000 | 1000 | | |
1001 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
1002 | 1008 | | |
1003 | 1009 | | |
1004 | 1010 | | |
| |||
0 commit comments