]> git.itanic.dy.fi Git - linux-stable/commit
ALSA: usb-audio: Fix an out-of-bounds bug in __snd_usb_parse_audio_interface()
authorDongxiang Ke <kdx.glider@gmail.com>
Tue, 6 Sep 2022 02:49:28 +0000 (10:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:32:03 +0000 (11:32 +0200)
commit6123bec8480d23369e2ee0b2208611619f269faf
treedb04ca680695dc50e75f98cace269371f2388723
parentab730d3c44918f5cb9b2abc1e463cd0b80bfaa94
ALSA: usb-audio: Fix an out-of-bounds bug in __snd_usb_parse_audio_interface()

commit e53f47f6c1a56d2af728909f1cb894da6b43d9bf upstream.

There may be a bad USB audio device with a USB ID of (0x04fa, 0x4201) and
the number of it's interfaces less than 4, an out-of-bounds read bug occurs
when parsing the interface descriptor for this device.

Fix this by checking the number of interfaces.

Signed-off-by: Dongxiang Ke <kdx.glider@gmail.com>
Link: https://lore.kernel.org/r/20220906024928.10951-1-kdx.glider@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/stream.c