Skip to content

Commit 689eb09

Browse files
lrgirdwokv2019i
authored andcommitted
base_fw: reject undersized system time payload
The system-time handler dereferenced the payload as a fixed struct without checking the supplied size, reading past the mailbox for a short payload. Reject a payload smaller than the struct. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent e62284b commit 689eb09

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/audio/base_fw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ __cold static uint32_t basefw_set_system_time(uint32_t param_id, bool first_bloc
277277
if (!(first_block && last_block))
278278
return IPC4_INVALID_REQUEST;
279279

280+
if (data_offset < sizeof(struct ipc4_system_time))
281+
return IPC4_ERROR_INVALID_PARAM;
282+
280283
global_system_time_info.host_time.val_l = ((const struct ipc4_system_time *)data)->val_l;
281284
global_system_time_info.host_time.val_u = ((const struct ipc4_system_time *)data)->val_u;
282285

0 commit comments

Comments
 (0)