Skip to content

module_adapter: validate channels and cadence tlv#10902

Merged
kv2019i merged 2 commits into
thesofproject:mainfrom
abonislawski:fix/module_adapter-cadence
Jun 17, 2026
Merged

module_adapter: validate channels and cadence tlv#10902
kv2019i merged 2 commits into
thesofproject:mainfrom
abonislawski:fix/module_adapter-cadence

Conversation

@abonislawski

Copy link
Copy Markdown
Member

No description provided.

Reject 0 or > PLATFORM_MAX_CHANNELS before modules index channel-sized arrays.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copilot AI review requested due to automatic review settings June 12, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds defensive validation for host-supplied configuration blobs to prevent out-of-bounds access during module configuration.

Changes:

  • Validate channels_count against PLATFORM_MAX_CHANNELS in IPC4 module adapter init.
  • Validate TLV/parameter blob sizes before using cadence codec parameters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/audio/module_adapter/module_adapter_ipc4.c Adds bounds-check for host-provided channel count to keep array indexing safe.
src/audio/module_adapter/module/cadence.c Adds param size validation for host-supplied TLV blob to avoid malformed-buffer handling issues.

Comment thread src/audio/module_adapter/module/cadence.c

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix perhaps forgotten in push... check inline comment.

Comment thread src/audio/module_adapter/module/cadence.c
Bound each host-supplied module_param against the bytes remaining
to avoid an OOB read or a stalled loop.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
@abonislawski abonislawski force-pushed the fix/module_adapter-cadence branch 2 times, most recently from 1fed0c2 to 6fa7b03 Compare June 16, 2026 09:54
@abonislawski abonislawski requested a review from kv2019i June 17, 2026 07:17
@kv2019i kv2019i merged commit f6d5bf5 into thesofproject:main Jun 17, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants