Repository navigation
testbench: ipc4: bound mixer max against volume table size - #11304
Open
Shrusti-pk wants to merge 1 commit into
Open
Shrusti-pk wants to merge 1 commit into
Shrusti-pk wants to merge 1 commit into
Conversation
tb_kcontrol_cb_new() fills ctl->volume_table[i] for i in [0, tplg_mixer->max] while loading a VOLSW mixer control from a topology file. volume_table is a fixed unsigned int[TB_MAX_VOLUME_SIZE] (120) in struct tb_ctl, but max is the __u32 field copied verbatim from the topology blob with no upper bound, so a control declaring max >= 120 writes past volume_table and the rest of the struct, and a large max runs far past the glb->ctl allocation. max + 1 also wraps to 0 when max is UINT32_MAX. Reject max >= TB_MAX_VOLUME_SIZE before the fill loop. This also keeps the later volume_table[control_values[i]] reads in bounds, as they are limited to the same max. Signed-off-by: Shrushti P K <shrusthi@labs.digiscrypt.com>
Collaborator
|
Can one of the admins verify this patch?
|
lgirdwood
approved these changes
Oct 14, 2026
Member
|
test this please |
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.
tb_kcontrol_cb_newpopulates a fixedvolume_table[TB_MAX_VOLUME_SIZE](120) from a VOLSW mixer control in the topology file:iover[0, tplg_mixer->max], andmaxis the__u32copied straight from the.tplgblob with no upper boundmax >= 120writes pastvolume_tableand the rest ofstruct tb_ctl; a largemaxruns far past theglb->ctlallocation (ASan reports WRITE 0 bytes after a 640-byte region)max + 1also wraps to 0 whenmaxisUINT32_MAXReject
max >= TB_MAX_VOLUME_SIZEbefore the loop. The latervolume_table[control_values[i]]reads are limited to the samemax, so they stay in bounds too.