Skip to content

Commit 88707ca

Browse files
abonislawskijajanusz
authored andcommitted
ipc: header size validation fix
This patch will deny IPC headers with size 0 Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
1 parent 6581428 commit 88707ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ipc/handler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ struct sof_ipc_cmd_hdr *mailbox_validate(void)
121121
mailbox_hostbox_read(hdr, SOF_IPC_MSG_MAX_SIZE, 0, sizeof(*hdr));
122122

123123
/* validate component header */
124-
if (hdr->size > SOF_IPC_MSG_MAX_SIZE) {
125-
trace_ipc_error("ipc: msg too big at 0x%x", hdr->size);
124+
if (hdr->size < sizeof(*hdr) || hdr->size > SOF_IPC_MSG_MAX_SIZE) {
125+
trace_ipc_error("ipc: invalid size 0x%x", hdr->size);
126126
return NULL;
127127
}
128128

0 commit comments

Comments
 (0)