Skip to content

Commit 3e362bc

Browse files
committed
audio: base_fw: validate host core_id in KCPS allocation request
basefw_kcps_allocation_request() passed request->core_id from the host IPC payload straight into core_kcps_adjust(), which uses it to index kcps_consumption[CONFIG_CORE_COUNT]. An out-of-range core_id turns the add-assign into an arbitrary relative write into DSP .bss. Reject core_id >= CONFIG_CORE_COUNT at the IPC boundary, mirroring the existing check in schedulers_info_get(). Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent 3f7738d commit 3e362bc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/audio/base_fw.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ __cold static int basefw_kcps_allocation_request(struct ipc4_resource_kcps *requ
341341
assert_can_be_cold();
342342

343343
#if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
344+
if (request->core_id >= CONFIG_CORE_COUNT) {
345+
tr_err(&ipc_tr, "invalid core_id %u",
346+
request->core_id);
347+
return IPC4_ERROR_INVALID_PARAM;
348+
}
349+
344350
if (core_kcps_adjust(request->core_id, request->kcps))
345351
return IPC4_ERROR_INVALID_PARAM;
346352
#endif

0 commit comments

Comments
 (0)