linux-stable/sound/soc/sof
Dan Carpenter d133d67e7e ASoC: SOF: Add some bounds checking to firmware data
[ Upstream commit 98f681b0f8 ]

Smatch complains about "head->full_size - head->header_size" can
underflow.  To some extent, we're always going to have to trust the
firmware a bit.  However, it's easy enough to add a check for negatives,
and let's add a upper bounds check as well.

Fixes: d2458baa79 ("ASoC: SOF: ipc3-loader: Implement firmware parsing and loading")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://msgid.link/r/5593d147-058c-4de3-a6f5-540ecb96f6f8@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:20:48 -04:00
..
amd ASoC: SOF: amd: fix for firmware reload failure after playback 2023-10-19 23:08:51 +02:00
imx
intel ASoC: SOF: Intel: hda-codec: Delay the codec device registration 2024-01-20 11:50:10 +01:00
mediatek
xtensa
compress.c
control.c
core.c ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. 2023-11-20 11:52:06 +01:00
debug.c ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions 2023-06-09 10:34:13 +02:00
iomem-utils.c
ipc.c
ipc3-control.c
ipc3-dtrace.c ASoC: SOF: ipc3-dtrace: uninitialized data in dfsentry_trace_filter_write() 2023-07-27 08:50:40 +02:00
ipc3-loader.c ASoC: SOF: Add some bounds checking to firmware data 2024-03-26 18:20:48 -04:00
ipc3-pcm.c
ipc3-priv.h
ipc3-topology.c
ipc3.c ASoC: SOF: ipc3: Check for upper size limit for the received message 2023-04-06 12:10:38 +02:00
ipc4-control.c ASoC: SOF: IPC4: update gain ipc msg definition to align with fw 2023-04-06 12:10:39 +02:00
ipc4-loader.c ASoC: SOF: Introduce container struct for SOF firmware 2024-03-26 18:20:48 -04:00
ipc4-mtrace.c ASoC: SOF: ipc4-mtrace: prevent underflow in sof_ipc4_priority_mask_dfs_write() 2023-02-09 11:28:01 +01:00
ipc4-pcm.c
ipc4-priv.h
ipc4-topology.c ASoC: SOF: IPC4: update gain ipc msg definition to align with fw 2023-04-06 12:10:39 +02:00
ipc4-topology.h ASoC: SOF: IPC4: update gain ipc msg definition to align with fw 2023-04-06 12:10:39 +02:00
ipc4.c ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware 2023-11-28 17:06:59 +00:00
Kconfig
loader.c ASoC: SOF: Introduce container struct for SOF firmware 2024-03-26 18:20:48 -04:00
Makefile
nocodec.c
ops.c
ops.h
pcm.c ASoC: SOF: pcm: fix pm_runtime imbalance in error handling 2023-06-09 10:34:13 +02:00
pm.c ASoC: SOF: pm: save io region state in case of errors in resume 2023-06-09 10:34:13 +02:00
sof-acpi-dev.c
sof-acpi-dev.h
sof-audio.c ASoC: SOF: Pass PCI SSID to machine driver 2023-11-28 17:06:58 +00:00
sof-audio.h
sof-client-ipc-flood-test.c
sof-client-ipc-msg-injector.c
sof-client-probes.c ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling 2023-06-09 10:34:13 +02:00
sof-client-probes.h
sof-client.c
sof-client.h
sof-of-dev.c
sof-of-dev.h
sof-pci-dev.c ASoC: SOF: Pass PCI SSID to machine driver 2023-11-28 17:06:58 +00:00
sof-pci-dev.h
sof-priv.h ASoC: SOF: Introduce container struct for SOF firmware 2024-03-26 18:20:48 -04:00
sof-utils.c
sof-utils.h
stream-ipc.c
topology.c ASoC: SOF: topology: simplify code to prevent static analysis warnings 2023-09-23 11:11:04 +02:00
trace.c