ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit()
authorTakashi Iwai <tiwai@suse.de>
Wed, 19 Dec 2018 11:36:27 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:51:06 +0000 (09:51 +0100)
commit8ee6f180d56fe760b275ab7f060c7b12fc05d7b7
treedf0a118c9b1715f48dc2a5b8671ff3ae84b4c88b
parent281a9e46a94c18d3c4377aee3221b89aa65d2e00
ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit()

commit f4351a199cc120ff9d59e06d02e8657d08e6cc46 upstream.

The parser for the processing unit reads bNrInPins field before the
bLength sanity check, which may lead to an out-of-bound access when a
malformed descriptor is given.  Fix it by assignment after the bLength
check.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/mixer.c