]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix potential out-of-bound access at parsing SU
authorTakashi Iwai <tiwai@suse.de>
Tue, 21 Nov 2017 16:00:32 +0000 (17:00 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 21 Nov 2017 16:50:31 +0000 (17:50 +0100)
commitd415fdfb54ca2d6200ea8377bbf9c2803505ebcb
treebb2746f2604b3c41bd44c9b0f181ed47d6fc86fa
parent18665a157f0905d721467fc5446b8c697f2fe009
ALSA: usb-audio: Fix potential out-of-bound access at parsing SU

The usb-audio driver may trigger an out-of-bound access at parsing a
malformed selector unit, as it checks the header length only after
evaluating bNrInPins field, which can be already above the given
length.  Fix it by adding the length check beforehand.

Fixes: 68e3d86f3afe ("ALSA: usb-mixer: parse descriptors with structs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c