mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
ALSA: usb-audio: Fix copy&paste error in the validator
commitba8bf0967aupstream. 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:57f8770620("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e005188924
commit
4ebee4875e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user