Skip to content

Commit 6d5cf82

Browse files
committed
audio: data_blob: reject first_block while transfer in progress
ipc4_comp_data_blob_set() had no busy check, so a new first_block received mid-transfer skipped reallocation but still updated new_data_size, defeating the memcpy_s bound and allowing a host-controlled heap overflow. Reject it with -EBUSY, mirroring comp_data_blob_set() and comp_data_blob_set_cmd(). Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent 06900eb commit 6d5cf82

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/audio/data_blob.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,14 @@ int ipc4_comp_data_blob_set(struct comp_data_blob_handler *blob_handler,
330330
"data_offset = %d",
331331
data_offset);
332332

333+
/* Reject a new first_block mid-transfer: reusing stale data_new while
334+
* overwriting new_data_size defeats the memcpy_s bound (heap overflow).
335+
*/
336+
if (blob_handler->data_new && first_block) {
337+
comp_err(blob_handler->dev, "busy with previous request");
338+
return -EBUSY;
339+
}
340+
333341
/* in case when the current package is the first, we should allocate
334342
* memory for whole model data
335343
*/

0 commit comments

Comments
 (0)