Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ipc/ipc4/handler-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,14 @@ __cold static int ipc4_get_large_config_module_instance(struct ipc4_message_requ

/* check for vendor param first */
if (config.extension.r.large_param_id == VENDOR_CONFIG_PARAM) {
/* data_off_size is a 20-bit host-controlled field, so it can
* claim far more than the hostbox can physically hold.
*/
if (data_offset > MAILBOX_HOSTBOX_SIZE) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to include the container size or current offset in the calculation ? e.g. if object size + data_offset > MAILBOX_SIZE ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think data is set to start of the mailbox, so this would be correct.

ipc_cmd_err(&ipc_tr, "data_off_size %u exceeds mailbox bound",
data_offset);
return IPC4_INVALID_CONFIG_DATA_STRUCT;
}
/* For now only vendor_config case uses payload from hostbox */
dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE,
config.extension.r.data_off_size);
Expand Down
Loading