Skip to content

Commit fcbe487

Browse files
cujomalaineybroonie
authored andcommitted
ASoC: SOF: IPC3: fix message bounds on ipc ops
commit 74ad8ed ("ASoC: SOF: ipc3: Implement rx_msg IPC ops") introduced a new allocation before the upper bounds check in do_rx_work. As a result A DSP can cause bad allocations if spewing garbage. Fixes: 74ad8ed ("ASoC: SOF: ipc3: Implement rx_msg IPC ops") Reported-by: Tim Van Patten <[email protected]> Cc: [email protected] Signed-off-by: Curtis Malainey <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c40aad7 commit fcbe487

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
@@ -1067,7 +1067,7 @@ static void sof_ipc3_rx_msg(struct snd_sof_dev *sdev)
10671067
return;
10681068
}
10691069

1070-
if (hdr.size < sizeof(hdr)) {
1070+
if (hdr.size < sizeof(hdr) || hdr.size > SOF_IPC_MSG_MAX_SIZE) {
10711071
dev_err(sdev->dev, "The received message size is invalid\n");
10721072
return;
10731073
}

0 commit comments

Comments
 (0)