]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: usb-audio: Fix UAC3 cluster descriptor size check
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Fri, 24 Apr 2026 21:50:10 +0000 (18:50 -0300)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Apr 2026 11:51:07 +0000 (13:51 +0200)
commit26265dd69da32d88a88d21987853cec899d9e21f
tree6935ae0c2a062520707ea30081b51237cf612600
parente5c33cdc6f402eab8abd36ecf436b22c9d3a8aff
ALSA: usb-audio: Fix UAC3 cluster descriptor size check

The UAC3 cluster descriptor length check in
snd_usb_get_audioformat_uac3()was added to
make sure that the buffer is large enough for
a struct uac3_cluster_header_descriptor before the
returned data is cast and used.

However, the check uses sizeof(cluster), where cluster
is a pointer, not the size of the descriptor header.
This makes the validation depend on the architecture
pointer size and does not match the intended object size.

Check against sizeof(*cluster) instead.

Fixes: fb4e2a6e8f28 ("ALSA: usb-audio: Fix out-of-bounds read in snd_usb_get_audioformat_uac3()")
Cc: stable@vger.kernel.org
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260424-alsa-usb-uac3-cluster-size-v1-1-99a5808898a3@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/stream.c