Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3()

The convert_chmap_v3() has a loop with its increment size of
cs_desc->wLength, but we forgot to validate cs_desc->wLength itself,
which may lead to potential endless loop by a malformed descriptor.

Add a proper size check to abort the loop for plugging the hole.

Fixes: ecfd41166b72 ("ALSA: usb-audio: Validate UAC3 cluster segment descriptors")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20260427152224.15276-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+2
+2
sound/usb/stream.c
··· 353 353 if (len < sizeof(*cs_desc)) 354 354 break; 355 355 cs_len = le16_to_cpu(cs_desc->wLength); 356 + if (cs_len < sizeof(*cs_desc)) 357 + break; 356 358 if (len < cs_len) 357 359 break; 358 360 cs_type = cs_desc->bSegmentType;