Skip to content

Commit 499ffd1

Browse files
jundorokSasha Levin
authored andcommitted
ALSA: usb-audio: Use correct version for UAC3 header validation
commit 54f9d64 upstream. The entry of the validators table for UAC3 AC header descriptor is defined with the wrong protocol version UAC_VERSION_2, while it should have been UAC_VERSION_3. This results in the validator never matching for actual UAC3 devices (protocol == UAC_VERSION_3), causing their header descriptors to bypass validation entirely. A malicious USB device presenting a truncated UAC3 header could exploit this to cause out-of-bounds reads when the driver later accesses unvalidated descriptor fields. The bug was introduced in the same commit as the recently fixed UAC3 feature unit sub-type typo, and appears to be from the same copy-paste error when the UAC3 section was created from the UAC2 section. Fixes: 57f8770 ("ALSA: usb-audio: More validations of descriptor units") Cc: <stable@vger.kernel.org> Signed-off-by: Jun Seo <jun.seo.93@proton.me> Link: https://patch.msgid.link/20260226010820.36529-1-jun.seo.93@proton.me Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b0126b5 commit 499ffd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/usb/validate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static const struct usb_desc_validator audio_validators[] = {
281281
/* UAC_VERSION_2, UAC2_SAMPLE_RATE_CONVERTER: not implemented yet */
282282

283283
/* UAC3 */
284-
FIXED(UAC_VERSION_2, UAC_HEADER, struct uac3_ac_header_descriptor),
284+
FIXED(UAC_VERSION_3, UAC_HEADER, struct uac3_ac_header_descriptor),
285285
FIXED(UAC_VERSION_3, UAC_INPUT_TERMINAL,
286286
struct uac3_input_terminal_descriptor),
287287
FIXED(UAC_VERSION_3, UAC_OUTPUT_TERMINAL,

0 commit comments

Comments
 (0)