]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: usb-audio: validate full match when resolving quirk aliases
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Wed, 18 Mar 2026 14:08:46 +0000 (11:08 -0300)
committerTakashi Iwai <tiwai@suse.de>
Wed, 18 Mar 2026 16:02:37 +0000 (17:02 +0100)
commitdf3eec203b940bad98a7c0b7ec0edaaaa8cd0247
tree74347d94955edfe0b6af11f4f3e751203e7a285b
parent785639b5bf2a87eaf0cda14baaa068b3728c7be2
ALSA: usb-audio: validate full match when resolving quirk aliases

get_alias_quirk() resolves a quirk for an aliased USB ID by scanning
usb_audio_ids[], but it currently checks only the vendor/product pair.

This is weak for quirk table entries that also depend on additional
USB_DEVICE_ID match fields, such as device or interface class,
subclass, protocol, interface number, or bcdDevice range.

Keep the aliased vid:pid as the lookup key, then validate only the
remaining match criteria of each candidate entry against the real
device/interface descriptors by clearing USB_DEVICE_ID_MATCH_DEVICE
from a temporary copy and passing it to usb_match_one_id().

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260318-alsa-usb-fix-quirk-alias-v3-1-bd3b17a32939@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c