Repository navigation
Commit 4cdb5b0
audio: data_blob: fail gracefully on oversized SET fragment
comp_data_blob_set_cmd() reassembles a host-provided blob from multiple
SOF_IPC_COMP_SET_DATA fragments. cdata->num_elems and cdata->data->size
are host-controlled. When a fragment's num_elems exceeds the remaining
capacity (new_data_size - data_pos), memcpy_s() correctly refuses the
copy and returns non-zero, but the following assert(!ret) then panics
the DSP. A single malformed host SET request (small declared size,
larger num_elems) is therefore enough to crash the firmware.
Replace the assert with a graceful error path that frees and resets the
in-progress blob state and returns the error to the IPC caller,
mirroring the earlier IPC4 fix in ipc4_comp_data_blob_set() (commit
93be3b1). The destination size passed to memcpy_s() was already
correct, so no bound is changed and legitimate transfers are unaffected.
Found by libFuzzer IPC3/UBSan; all six reproducers now return cleanly
and the ipc3 corpus (44828 runs) shows no regression.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>1 parent eb51ed2 commit 4cdb5b0
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
547 | 555 | | |
548 | 556 | | |
549 | 557 | | |
| |||
0 commit comments