Re: [PATCH] ALSA: usb-audio: stop parsing UAC2 rates at MAX_NR_RATES
From: Takashi Iwai
Date: Thu Apr 16 2026 - 04:59:08 EST
On Wed, 15 Apr 2026 17:04:53 +0200,
Cássio Gabriel wrote:
>
> parse_uac2_sample_rate_range() caps the number of enumerated
> rates at MAX_NR_RATES, but it only breaks out of the current
> rate loop. A malformed UAC2 RANGE response with additional
> triplets continues parsing the remaining triplets and repeatedly
> prints "invalid uac2 rates" while probe still holds
> register_mutex.
>
> Stop the whole parse once the cap is reached and return the
> number of rates collected so far.
>
> Fixes: 4fa0e81b8350 ("ALSA: usb-audio: fix possible hang and overflow in parse_uac2_sample_rate_range()")
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: syzbot+d56178c27a4710960820@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=d56178c27a4710960820
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
Thanks, applied now.
Takashi