ALSA: usb-audio: More validations of descriptor units
authorTakashi Iwai <tiwai@suse.de>
Tue, 20 Aug 2019 15:17:09 +0000 (17:17 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 22 Aug 2019 08:35:59 +0000 (10:35 +0200)
commit57f8770620e9b51c61089751f0b5ad3dbe376ff2
tree3302223d107681aa8b7558e68fdf1bf322cdc4b4
parentf9f0e9ed350e15d51ad07364b4cf910de50c472a
ALSA: usb-audio: More validations of descriptor units

Introduce a new helper to validate each audio descriptor unit before
and check the unit before actually accessing it.  This should harden
against the OOB access cases with malformed descriptors that have been
recently frequently reported by fuzzers.

The existing descriptor checks are still kept although they become
superfluous after this patch.  They'll be cleaned up eventually
later.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/Makefile
sound/usb/helper.h
sound/usb/mixer.c
sound/usb/power.c
sound/usb/quirks.c
sound/usb/stream.c
sound/usb/validate.c [new file with mode: 0644]