OpenCloudOS-Kernel/drivers/firmware/cirrus
Richard Fitzgerald 392cff2f86 firmware: cs_dsp: Use strnlen() on name fields in V1 wmfw files
[ Upstream commit 680e126ec0400f6daecf0510c5bb97a55779ff03 ]

Use strnlen() instead of strlen() on the algorithm and coefficient name
string arrays in V1 wmfw files.

In V1 wmfw files the name is a NUL-terminated string in a fixed-size
array. cs_dsp should protect against overrunning the array if the NUL
terminator is missing.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: f6bc909e76 ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs")
Link: https://patch.msgid.link/20240708144855.385332-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-18 13:21:16 +02:00
..
Kconfig firmware: cs_dsp: Rename KConfig symbol CS_DSP -> FW_CS_DSP 2022-11-25 11:53:59 +00:00
Makefile firmware: cs_dsp: Rename KConfig symbol CS_DSP -> FW_CS_DSP 2022-11-25 11:53:59 +00:00
cs_dsp.c firmware: cs_dsp: Use strnlen() on name fields in V1 wmfw files 2024-07-18 13:21:16 +02:00