Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control()
@ 2023-02-03  6:00 Артемий Карасев
  0 siblings, 0 replies; only message in thread
From: Артемий Карасев @ 2023-02-03  6:00 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	lvc-project


In snd_emux_control() method "snd_emux_port" can be passed with 
field chset.midi_mode == SNDRV_MIDI_MODE_XG. The "type" can be 
MIDI_CTL_PITCHBEND or MIDI_CTL_CHAN_PRESSURE.
It may lead to accessing 'control' array of size 128 with 
MIDI_CTL_PITCHBEND (0x80) or MIDI_CTL_CHAN_PRESSURE (0x82) index.
 
How can we prevent this? Would it be a good solution to place code like this 
before call snd_emux_xg_control()?
 
if (type == MIDI_CTL_PITCHBEND || type == MIDI_CTL_CHAN_PRESSURE){
    return;
}
 
Found by Linux Verification Center (linuxtesting.org) with SVACE.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-03  6:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-03  6:00 ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() Артемий Карасев

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox