OSDN Git Service

ALSA: usb-audio: Add sanity checks to FE parser
authorTakashi Iwai <tiwai@suse.de>
Tue, 21 Nov 2017 15:55:51 +0000 (16:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:39:05 +0000 (08:39 +0000)
commit85cc020b46b5728e6cd4557b493ff27e4482774f
tree9f1b1859fec6d8cecb8812445936376d033571ed
parent14eb4545929845f557ca8e16475c8209e1713360
ALSA: usb-audio: Add sanity checks to FE parser

commit d937cd6790a2bef2d07b500487646bd794c039bb upstream.

When the usb-audio descriptor contains the malformed feature unit
description with a too short length, the driver may access
out-of-bounds.  Add a sanity check of the header size at the beginning
of parse_audio_feature_unit().

Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/mixer.c