* [PATCH] ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control()
@ 2023-02-07 13:20 Artemii Karasev
2023-02-07 13:32 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Artemii Karasev @ 2023-02-07 13:20 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai
Cc: Artemii Karasev, alsa-devel, linux-kernel, lvc-project
snd_emux_xg_control() can be called with an argument 'param' greater
than size of 'control' array. It may lead to accessing 'control'
array at a wrong index.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Artemii Karasev <karasev@ispras.ru>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
sound/synth/emux/emux_nrpn.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/synth/emux/emux_nrpn.c b/sound/synth/emux/emux_nrpn.c
index 8056422ed7c5..9e6414f78e4b 100644
--- a/sound/synth/emux/emux_nrpn.c
+++ b/sound/synth/emux/emux_nrpn.c
@@ -349,6 +349,9 @@ int
snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan,
int param)
{
+ if (param >= ARRAY_SIZE(chan->control))
+ return -EINVAL;
+
return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
port, chan, param,
chan->control[param],
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control()
2023-02-07 13:20 [PATCH] ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() Artemii Karasev
@ 2023-02-07 13:32 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2023-02-07 13:32 UTC (permalink / raw)
To: Artemii Karasev
Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel, lvc-project
On Tue, 07 Feb 2023 14:20:26 +0100,
Artemii Karasev wrote:
>
> snd_emux_xg_control() can be called with an argument 'param' greater
> than size of 'control' array. It may lead to accessing 'control'
> array at a wrong index.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Artemii Karasev <karasev@ispras.ru>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Thanks, applied now.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-07 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 13:20 [PATCH] ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() Artemii Karasev
2023-02-07 13:32 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®