mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()
@ 2023-08-07  7:51 Xia Fukun
  2023-08-07 17:54 ` Curtis Malainey
  2023-08-07 21:34 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Xia Fukun @ 2023-08-07  7:51 UTC (permalink / raw)
  To: peter.ujfalusi, broonie, pierre-louis.bossart, ranjani.sridharan,
	yung-chuan.liao, cujomalainey, noah.klayman, daniel.baluta,
	rander.wang
  Cc: linux-kernel, xiafukun

Here hdr is a pointer, and we should measure the size of
struct sof_ipc_cmd_hdr.

Fixes: 12c41c779fad ("ASoC: SOF: Refactor rx function for fuzzing")
Signed-off-by: Xia Fukun <xiafukun@huawei.com>
---
 sound/soc/sof/ipc3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/ipc3.c b/sound/soc/sof/ipc3.c
index 2c5aac31e8b0..580960ff273d 100644
--- a/sound/soc/sof/ipc3.c
+++ b/sound/soc/sof/ipc3.c
@@ -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);
 
-	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",
 			hdr->size);
 		return;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()
  2023-08-07  7:51 [PATCH] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work() Xia Fukun
@ 2023-08-07 17:54 ` Curtis Malainey
  2023-08-07 21:34 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Curtis Malainey @ 2023-08-07 17:54 UTC (permalink / raw)
  To: Xia Fukun
  Cc: peter.ujfalusi, broonie, pierre-louis.bossart, ranjani.sridharan,
	yung-chuan.liao, cujomalainey, noah.klayman, daniel.baluta,
	rander.wang, linux-kernel

On Mon, Aug 7, 2023 at 12:52 AM Xia Fukun <xiafukun@huawei.com> wrote:
>
> Here hdr is a pointer, and we should measure the size of
> struct sof_ipc_cmd_hdr.
>
> Fixes: 12c41c779fad ("ASoC: SOF: Refactor rx function for fuzzing")
> Signed-off-by: Xia Fukun <xiafukun@huawei.com>

Thanks for catching this

Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()
  2023-08-07  7:51 [PATCH] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work() Xia Fukun
  2023-08-07 17:54 ` Curtis Malainey
@ 2023-08-07 21:34 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-08-07 21:34 UTC (permalink / raw)
  To: peter.ujfalusi, pierre-louis.bossart, ranjani.sridharan,
	yung-chuan.liao, cujomalainey, noah.klayman, daniel.baluta,
	rander.wang, Xia Fukun
  Cc: linux-kernel

On Mon, 07 Aug 2023 15:51:18 +0800, Xia Fukun wrote:
> Here hdr is a pointer, and we should measure the size of
> struct sof_ipc_cmd_hdr.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()
      commit: 41aad0905568508070842e22ebc5398f8b733939

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-07 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07  7:51 [PATCH] ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work() Xia Fukun
2023-08-07 17:54 ` Curtis Malainey
2023-08-07 21:34 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®