Skip to content

Commit be09b47

Browse files
tiwaigregkh
authored andcommitted
ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3()
commit 6e7247d upstream. 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: ecfd411 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 00e095d commit be09b47

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/usb/stream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ snd_pcm_chmap_elem *convert_chmap_v3(struct uac3_cluster_header_descriptor
352352
if (len < sizeof(*cs_desc))
353353
break;
354354
cs_len = le16_to_cpu(cs_desc->wLength);
355+
if (cs_len < sizeof(*cs_desc))
356+
break;
355357
if (len < cs_len)
356358
break;
357359
cs_type = cs_desc->bSegmentType;

0 commit comments

Comments
 (0)