firmware: cs_dsp: Fix OOB memory read access in KUnit test (ctl cache)
Subsystems (3)
Jaroslav Kysela
maintainerPATCH 1/1 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.
--- drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c | 1 - 1 file changed, 1 deletion(-)
drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c +0 -1
@@ -776,7 +776,6 @@ static void cs_dsp_ctl_cache_init_multiple_offsets(struct kunit *test) "dummyalg", NULL);/* Create controls identical except for offset */ - def.length_bytes =8 ; def.offset_dsp_words =0 ; def.shortname ="CtlA" ;cs_dsp_mock_wmfw_add_coeff_desc (local->wmfw_builder, &def);
Signature · 1 line
2.49.0
Quoted 8 lines · Jaroslav Kysela
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.
Quoted 6 lines
Cc Simon Trimmer <[email protected]>Cc Charles Keepax <[email protected]>Cc Richard Fitzgerald <[email protected]>Signed-off-by Jaroslav Kysela <[email protected]>
Quoted 9 lines · Jaroslav Kysela
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.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] firmware: cs_dsp: Fix OOB memory read access in KUnit test (ctl cache)
commit: f4ba2ea57da51d616b689c4b8826c517ff5a8523
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