audio: multiband_drc: add IPC-time blob validator#10967
Draft
singalsu wants to merge 1 commit into
Draft
Conversation
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>
Contributor
There was a problem hiding this comment.
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, headersizeconsistency,num_bandsrange, and exact payload sizing. - Registered the validator in
multiband_drc_init()viacomp_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.
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.
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.