aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/card.h
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2012-02-14 05:18:48 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-07 12:46:48 -0700
commit93a327fcdef0c9e089ba7b347780cf9eaa92677f (patch)
tree79da5eb7b8f9628106eee38af666d6967203dfde /sound/usb/card.h
parent44f059fb742aac78cffdab5e0d8fe0c9910c1ded (diff)
downloadkernel_samsung_smdk4412-93a327fcdef0c9e089ba7b347780cf9eaa92677f.zip
kernel_samsung_smdk4412-93a327fcdef0c9e089ba7b347780cf9eaa92677f.tar.gz
kernel_samsung_smdk4412-93a327fcdef0c9e089ba7b347780cf9eaa92677f.tar.bz2
ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()
commit 8866f405efd4171f9d9c91901d2dd02f01bacb60 upstream. 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 4fa0e81b ("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> Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/usb/card.h')
-rw-r--r--sound/usb/card.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/card.h b/sound/usb/card.h
index 19b5b5d..da61252 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -1,6 +1,7 @@
#ifndef __USBAUDIO_CARD_H
#define __USBAUDIO_CARD_H
+#define MAX_NR_RATES 1024
#define MAX_PACKS 20
#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */
#define MAX_URBS 8