Commit a224f33
committed
audio: tdfb: register IPC-time blob validator
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. Each filter_angles[].filter_index is also range-
checked against the total filter count so a bad index in any angle
entry is caught at ingress, not only when that angle happens to be
selected at runtime. The same walk is reused at prepare time on the
initial topology blob; a malformed initial blob is discarded
(cd->config cleared) so the runtime path will not dereference it.
With ingress fully validated, the redundant sanity checks inside
tdfb_init_coef() are dropped.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>1 parent 3bbc01e commit a224f33
2 files changed
Lines changed: 205 additions & 106 deletions
0 commit comments