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
10 changes: 8 additions & 2 deletions src/ipc/ipc4/handler-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,10 +1107,16 @@ __cold static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
assert_can_be_cold();

/* Validate host-controlled payload size before any use or arithmetic. */
if (data_off_size > MAILBOX_HOSTBOX_SIZE)
if (data_off_size > MAILBOX_HOSTBOX_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.

tr_dbg() logs are disabled by default, so not sure of the benefit., If we want to leave these in production binaries, we need to use err or warn. And not 100% sure this is worth the binary space to have the logs for errors like these that will only occur if completely out-of-spec IPC messages are sent by host.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Damn. Copilot stole my commit. I wrote the changes and only asked copilot to write the commit message and it stole all the credit.

tr_err(&ipc_tr, "data_off_size greater than mailbox %u > %u",
data_off_size, (uint32_t)MAILBOX_HOSTBOX_SIZE);
return IPC4_INVALID_CONFIG_DATA_STRUCT;
if (init_block && data_off_size < sizeof(struct sof_tlv))
}
if (init_block && data_off_size < sizeof(struct sof_tlv)) {
tr_err(&ipc_tr, "init_block data_off_size too small %u < %zu",
data_off_size, sizeof(struct sof_tlv));
return IPC4_INVALID_CONFIG_DATA_STRUCT;
}

/* Old FW comment: bursted configs */
if (init_block && final_block) {
Expand Down
Loading