* [PATCH] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[]
@ 2026-03-27 10:33 gerben
2026-04-02 3:00 ` Kuninori Morimoto
2026-04-03 12:37 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: gerben @ 2026-03-27 10:33 UTC (permalink / raw)
To: kuninori.morimoto.gx
Cc: lgirdwood, broonie, tiwai, linux-sound, linux-renesas-soc,
linux-kernel, lvc-project
From: Denis Rastyogin <gerben@altlinux.org>
component_dais[RSND_MAX_COMPONENT] is initially zero-initialized
and later populated in rsnd_dai_of_node(). However, the existing boundary check:
if (i >= RSND_MAX_COMPONENT)
does not guarantee that the last valid element remains zero. As a result,
the loop can rely on component_dais[RSND_MAX_COMPONENT] being zero,
which may lead to an out-of-bounds access.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 547b02f74e4a ("ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2")
Signed-off-by: Denis Rastyogin <gerben@altlinux.org>
---
sound/soc/renesas/rcar/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/renesas/rcar/core.c b/sound/soc/renesas/rcar/core.c
index 69fb19964a71..2dc078358612 100644
--- a/sound/soc/renesas/rcar/core.c
+++ b/sound/soc/renesas/rcar/core.c
@@ -1974,7 +1974,7 @@ static int rsnd_probe(struct platform_device *pdev)
* asoc register
*/
ci = 0;
- for (i = 0; priv->component_dais[i] > 0; i++) {
+ for (i = 0; i < RSND_MAX_COMPONENT && priv->component_dais[i] > 0; i++) {
int nr = priv->component_dais[i];
ret = devm_snd_soc_register_component(dev, &rsnd_soc_component,
--
2.42.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[]
2026-03-27 10:33 [PATCH] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[] gerben
@ 2026-04-02 3:00 ` Kuninori Morimoto
2026-04-03 12:37 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2026-04-02 3:00 UTC (permalink / raw)
To: gerben
Cc: lgirdwood, broonie, tiwai, linux-sound, linux-renesas-soc,
linux-kernel, lvc-project
Hi
> From: Denis Rastyogin <gerben@altlinux.org>
>
> component_dais[RSND_MAX_COMPONENT] is initially zero-initialized
> and later populated in rsnd_dai_of_node(). However, the existing boundary check:
> if (i >= RSND_MAX_COMPONENT)
>
> does not guarantee that the last valid element remains zero. As a result,
> the loop can rely on component_dais[RSND_MAX_COMPONENT] being zero,
> which may lead to an out-of-bounds access.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 547b02f74e4a ("ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2")
> Signed-off-by: Denis Rastyogin <gerben@altlinux.org>
> ---
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
# I'm not sure why, but sometimes the mail is not comming to my mailbox
# even though it has To/Cc to me.
# I couldn't find it on spam folder either...
# I have noticed this patch via lore.kernel.org
Thank you for your help !!
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[]
2026-03-27 10:33 [PATCH] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[] gerben
2026-04-02 3:00 ` Kuninori Morimoto
@ 2026-04-03 12:37 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-04-03 12:37 UTC (permalink / raw)
To: kuninori.morimoto.gx, gerben
Cc: lgirdwood, tiwai, linux-sound, linux-renesas-soc, linux-kernel,
lvc-project
On Fri, 27 Mar 2026 13:33:11 +0300, gerben@altlinux.org wrote:
> ASoC: rsnd: Fix potential out-of-bounds access of component_dais[]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1
Thanks!
[1/1] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[]
https://git.kernel.org/broonie/sound/c/f9e437cddf6c
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-03 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 10:33 [PATCH] ASoC: rsnd: Fix potential out-of-bounds access of component_dais[] gerben
2026-04-02 3:00 ` Kuninori Morimoto
2026-04-03 12:37 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox