]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()
authorXi Wang <xi.wang@gmail.com>
Tue, 14 Feb 2012 10:18:48 +0000 (05:18 -0500)
committerTakashi Iwai <tiwai@suse.de>
Wed, 15 Feb 2012 13:58:15 +0000 (14:58 +0100)
commit8be567dcea0007df98322c29a4e19a7d0da2cb2a
tree414b07ed6d979f9aad804dc16b4f280247741eaf
parent7320d8fdd891029ff823b21020ab2503161b437e
ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()

A malicious USB device could feed in a large nr_rates value.  This would
cause the subsequent call to kmemdup() to allocate a smaller buffer than
expected, leading to out-of-bounds access.

This patch validates the nr_rates value and reuses the limit introduced
in commit f8884a56 ("ALSA: usb-audio: fix possible hang and overflow
in parse_uac2_sample_rate_range()").

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.h
sound/usb/format.c
sound/usb/quirks.c