summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-10-22 17:45:14 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-12 19:27:29 +0100
commitd2f49f58b40e1680650bc36f9b5d3de626f57b09 (patch)
tree9969d00572795612419fff2129d3d37762e050fa /sound
parentaa07532bc86bd94b7cdafd3042d3e268a34f4cbe (diff)
downloadlinux-stable-d2f49f58b40e1680650bc36f9b5d3de626f57b09.tar.gz
linux-stable-d2f49f58b40e1680650bc36f9b5d3de626f57b09.tar.bz2
linux-stable-d2f49f58b40e1680650bc36f9b5d3de626f57b09.zip
ALSA: usb-audio: Fix copy&paste error in the validator
commit ba8bf0967a154796be15c4983603aad0b05c3138 upstream. The recently introduced USB-audio descriptor validator had a stupid copy&paste error that may lead to an unexpected overlook of too short descriptors for processing and extension units. It's likely the cause of the report triggered by syzkaller fuzzer. Let's fix it. Fixes: 57f8770620e9 ("ALSA: usb-audio: More validations of descriptor units") Reported-by: syzbot+0620f79a1978b1133fd7@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/s5hsgnkdbsl.wl-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/validate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/validate.c b/sound/usb/validate.c
index 3c8f73a0eb12..a5e584b60dcd 100644
--- a/sound/usb/validate.c
+++ b/sound/usb/validate.c
@@ -75,7 +75,7 @@ static bool validate_processing_unit(const void *p,
if (d->bLength < sizeof(*d))
return false;
- len = d->bLength < sizeof(*d) + d->bNrInPins;
+ len = sizeof(*d) + d->bNrInPins;
if (d->bLength < len)
return false;
switch (v->protocol) {