Skip to content

Commit eb6a85f

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 689eb09 commit eb6a85f

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
@@ -344,6 +344,12 @@ __cold static int basefw_kcps_allocation_request(struct ipc4_resource_kcps *requ
344344
assert_can_be_cold();
345345

346346
#if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
347+
if (request->core_id >= CONFIG_CORE_COUNT) {
348+
tr_err(&ipc_tr, "invalid core_id %u",
349+
request->core_id);
350+
return IPC4_ERROR_INVALID_PARAM;
351+
}
352+
347353
if (core_kcps_adjust(request->core_id, request->kcps))
348354
return IPC4_ERROR_INVALID_PARAM;
349355
#endif

0 commit comments

Comments
 (0)