Skip to content

audio: tdfb: register IPC-time blob validator#10944

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

audio: tdfb: register IPC-time blob validator#10944
singalsu wants to merge 1 commit into
thesofproject:mainfrom
singalsu:model_handler_validator_tdfb

Conversation

@singalsu

Copy link
Copy Markdown
Collaborator

Hook a tdfb blob validator into the model handler so a corrupted or mismatching run-time configuration update is rejected before it can replace the working blob. Capture then continues with the previously set filters instead of being interrupted by bad re-configuration.

The TDFB blob is variable size and the per-filter walk in tdfb_init_coef() was not bounded against the IPC payload, so a bad length field could push tdfb_filter_seek() past the buffer. The validator now walks every FIR section and the trailing arrays with byte-bounded steps, requires the total layout to exactly match config->size, and rejects blobs whose num_output_channels or input_channel_select[] entries do not fit the channel counts of the running stream. The same walk is reused at prepare time on the initial topology blob. With ingress fully validated, the redundant sanity checks inside tdfb_init_coef() are dropped.

Hook a tdfb blob validator into the model handler so a corrupted or
mismatching run-time configuration update is rejected before it can
replace the working blob. Capture then continues with the previously
set filters instead of being interrupted by bad re-configuration.

The TDFB blob is variable size and the per-filter walk in
tdfb_init_coef() was not bounded against the IPC payload, so a bad
length field could push tdfb_filter_seek() past the buffer. The
validator now walks every FIR section and the trailing arrays with
byte-bounded steps, requires the total layout to exactly match
config->size, and rejects blobs whose num_output_channels or
input_channel_select[] entries do not fit the channel counts of the
running stream. The same walk is reused at prepare time on the
initial topology blob. With ingress fully validated, the redundant
sanity checks inside tdfb_init_coef() are dropped.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
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.

1 participant