Skip to content

Commit 41aad09

Browse files
Xia Fukunbroonie
authored andcommitted
ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()
Here hdr is a pointer, and we should measure the size of struct sof_ipc_cmd_hdr. Fixes: 12c41c7 ("ASoC: SOF: Refactor rx function for fuzzing") Signed-off-by: Xia Fukun <xiafukun@huawei.com> Reviewed-by: Curtis Malainey <cujomalainey@chromium.org> Link: https://lore.kernel.org/r/20230807075118.128122-1-xiafukun@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 1f56643 commit 41aad09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sof/ipc3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ void sof_ipc3_do_rx_work(struct snd_sof_dev *sdev, struct sof_ipc_cmd_hdr *hdr,
10011001

10021002
ipc3_log_header(sdev->dev, "ipc rx", hdr->cmd);
10031003

1004-
if (hdr->size < sizeof(hdr) || hdr->size > SOF_IPC_MSG_MAX_SIZE) {
1004+
if (hdr->size < sizeof(*hdr) || hdr->size > SOF_IPC_MSG_MAX_SIZE) {
10051005
dev_err(sdev->dev, "The received message size is invalid: %u\n",
10061006
hdr->size);
10071007
return;

0 commit comments

Comments
 (0)