]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: More strict sanity checks for clock parsers
authorTakashi Iwai <tiwai@suse.de>
Wed, 4 Apr 2018 05:18:44 +0000 (07:18 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sat, 7 Apr 2018 11:07:11 +0000 (13:07 +0200)
commita336f5f7ea9128666fc81b0468837cd0880e1643
tree564bc879bdffa4aaaa01ec5f43b5b8d1f63a8ec1
parent555e5116872a07837232445cbb48fce9c4a61b86
ALSA: usb-audio: More strict sanity checks for clock parsers

The sanity checks introduced for malformed descriptors loosely check
the given descriptor size, although the size greater than the defined
description is invalid.  It was due to a concern of any funky firmware
in the actual products.  But this doesn't look hitting, and any sane
products must have the defined descriptors.

So in this patch, we make the validators more strict, allowing only
with the defined descriptor sizes.  The value in clock selector
validator is corrected from 5 to 7 to count the two unlisted fields
after baCSourceID[].

Suggested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/clock.c