]> Gentwo Git Trees - linux/.git/commit
firmware: cs_dsp: Fix OOB memory read access in KUnit test (ctl cache)
authorJaroslav Kysela <perex@perex.cz>
Fri, 23 May 2025 15:41:51 +0000 (17:41 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 26 May 2025 10:33:52 +0000 (11:33 +0100)
commitf4ba2ea57da51d616b689c4b8826c517ff5a8523
treec6cd9ebf77fe5ff33d3c0051291dca8126ac5123
parentd979b783d61f7f1f95664031b71a33afc74627b2
firmware: cs_dsp: Fix OOB memory read access in KUnit test (ctl cache)

KASAN reported out of bounds access - cs_dsp_ctl_cache_init_multiple_offsets().
The code uses mock_coeff_template.length_bytes (4 bytes) for register value
allocations. But later, this length is set to 8 bytes which causes
test code failures.

As fix, just remove the lenght override, keeping the original value 4
for all operations.

Cc: Simon Trimmer <simont@opensource.cirrus.com>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: patches@opensource.cirrus.com
Cc: stable@vger.kernel.org
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250523154151.1252585-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c