]> 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)
commit4c46ab9a1034a1cfcfe5f0ce902e0817e98f64c5
tree6dcce2c8bb1369d171bf085fa3ee3e9f6f661615
parentddfbfdd1ff5de63b9887a8ed50920471b8b1fb9e
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