Skip to content

Commit d4c5415

Browse files
author
Jyri Sarha
committed
ipc4: large_config: log rejected data_off_size validation failures
The data_off_size bounds checks in ipc4_set_vendor_config_module_instance() silently returned IPC4_INVALID_CONFIG_DATA_STRUCT, giving no clue why a MOD_LARGE_CONFIG_SET request was rejected. This makes diagnosing malformed or malicious topologies/host requests harder. Add tr_dbg() traces to both rejection paths reporting the offending data_off_size together with the limit it violated (the mailbox size for the upper bound, and sizeof(struct sof_tlv) for the init_block lower bound). No functional change to the validation itself. Signed-off-by: GitHub Copilot <noreply@github.com>
1 parent 689eb09 commit d4c5415

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/ipc/ipc4/handler-user.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,10 +1107,16 @@ __cold static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
11071107
assert_can_be_cold();
11081108

11091109
/* Validate host-controlled payload size before any use or arithmetic. */
1110-
if (data_off_size > MAILBOX_HOSTBOX_SIZE)
1110+
if (data_off_size > MAILBOX_HOSTBOX_SIZE) {
1111+
tr_dbg(&ipc_tr, "data_off_size greater than mailbox %u > %u",
1112+
data_off_size, MAILBOX_HOSTBOX_SIZE);
11111113
return IPC4_INVALID_CONFIG_DATA_STRUCT;
1112-
if (init_block && data_off_size < sizeof(struct sof_tlv))
1114+
}
1115+
if (init_block && data_off_size < sizeof(struct sof_tlv)) {
1116+
tr_dbg(&ipc_tr, "init_block data_off_size too small %u < %zu",
1117+
data_off_size, sizeof(struct sof_tlv));
11131118
return IPC4_INVALID_CONFIG_DATA_STRUCT;
1119+
}
11141120

11151121
/* Old FW comment: bursted configs */
11161122
if (init_block && final_block) {

0 commit comments

Comments
 (0)