]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Add sanity checks in v2 clock parsers
authorTakashi Iwai <tiwai@suse.de>
Tue, 21 Nov 2017 16:28:06 +0000 (17:28 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 21 Nov 2017 16:50:34 +0000 (17:50 +0100)
commit02659fbba200992a9e667dd49a18ca212810a9d0
tree6dcce2c8bb1369d171bf085fa3ee3e9f6f661615
parent27f36df3d860bec264329ea60af88014267f2ab3
ALSA: usb-audio: Add sanity checks in v2 clock parsers

The helper functions to parse and look for the clock source, selector
and multiplier unit may return the descriptor with a too short length
than required, while there is no sanity check in the caller side.
Add some sanity checks in the parsers, at least, to guarantee the
given descriptor size, for avoiding the potential crashes.

Fixes: 9c2331160209 ("ALSA: usb-audio: parse clock topology of UAC2 devices")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/clock.c