Commit 41aad090 authored by Xia Fukun's avatar Xia Fukun Committed by Mark Brown

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: 12c41c77 ("ASoC: SOF: Refactor rx function for fuzzing")
Signed-off-by: default avatarXia Fukun <xiafukun@huawei.com>
Reviewed-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230807075118.128122-1-xiafukun@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1f566435
...@@ -1001,7 +1001,7 @@ void sof_ipc3_do_rx_work(struct snd_sof_dev *sdev, struct sof_ipc_cmd_hdr *hdr, ...@@ -1001,7 +1001,7 @@ void sof_ipc3_do_rx_work(struct snd_sof_dev *sdev, struct sof_ipc_cmd_hdr *hdr,
ipc3_log_header(sdev->dev, "ipc rx", hdr->cmd); ipc3_log_header(sdev->dev, "ipc rx", hdr->cmd);
if (hdr->size < sizeof(hdr) || hdr->size > SOF_IPC_MSG_MAX_SIZE) { if (hdr->size < sizeof(*hdr) || hdr->size > SOF_IPC_MSG_MAX_SIZE) {
dev_err(sdev->dev, "The received message size is invalid: %u\n", dev_err(sdev->dev, "The received message size is invalid: %u\n",
hdr->size); hdr->size);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment