Skip to content

audio: multiband_drc: add IPC-time blob validator#10967

Draft
singalsu wants to merge 1 commit into
thesofproject:mainfrom
singalsu:model_handler_validator_multidrc
Draft

audio: multiband_drc: add IPC-time blob validator#10967
singalsu wants to merge 1 commit into
thesofproject:mainfrom
singalsu:model_handler_validator_multidrc

Conversation

@singalsu

@singalsu singalsu commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Hook a multiband_drc blob validator into the model handler so a corrupted run-time configuration update is rejected before it can replace the working blob. Playback or capture then continues with the previously set parameters instead of being interrupted by a bad IPC.

The blob is a fixed-size sof_multiband_drc_config header followed by num_bands sof_drc_params entries. The validator enforces the size envelope against SOF_MULTIBAND_DRC_MAX_BLOB_SIZE, requires the self-declared config->size to agree with the payload, and requires the payload to match base + num_bands * sizeof(sof_drc_params) exactly with num_bands in the valid range. It is installed in multiband_drc_init() when the model handler is created, so every blob swap is covered - including any received while the component is in READY - and the equivalent inline size guard that multiband_drc_prepare() used on the initial blob is dropped.

Hook a multiband_drc blob validator into the model handler so a
corrupted run-time configuration update is rejected before it can
replace the working blob. Playback or capture then continues with the
previously set parameters instead of being interrupted by a bad IPC.

The blob is a fixed-size sof_multiband_drc_config header followed by
num_bands sof_drc_params entries. The validator enforces the size
envelope against SOF_MULTIBAND_DRC_MAX_BLOB_SIZE, requires the
self-declared config->size to agree with the payload, and requires the
payload to match base + num_bands * sizeof(sof_drc_params) exactly with
num_bands in the valid range. It is installed in multiband_drc_init()
when the model handler is created, so every blob swap is covered -
including any received while the component is in READY - and the
equivalent inline size guard that multiband_drc_prepare() used on the
initial blob is dropped.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>

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

This PR adds an IPC-time configuration blob validator for the multiband_drc module so malformed run-time updates are rejected before they can replace a known-good configuration, allowing playback/capture to continue with the previous parameters.

Changes:

  • Added multiband_drc_validator() to validate blob size bounds, header size consistency, num_bands range, and exact payload sizing.
  • Registered the validator in multiband_drc_init() via comp_data_blob_set_validator() so all subsequent blob updates are checked at receipt time.
  • Removed the inline size guard in multiband_drc_prepare() and now relies on the validator for blob correctness.

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.

2 participants