From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 381313DC4C5 for ; Wed, 18 Mar 2026 16:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773849794; cv=none; b=ZRBTBiciprl7aTP4yC/dqlcu4Ek1xDLjvVjYEF6VQkXmyN/GB0Cbs2ZjbWVDpt1G9p12CA/PDx1oZI0RMkyNF/uJYN+FfbXlnR+ix2si1Z/ESDQPka0wfQi4DAEUUeCcLDdHDWq9nWg+UUpJ2I7YOxK+fe9qX8p78owGmjMObgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773849794; c=relaxed/simple; bh=wN5cUZ0zdT/TEHWDN+VcdHqBYQAS/OXnrrsWGfJoBvI=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=CUU021rrdu602pLCA8QZZKPKMt8ELo0WKSWnjMrNQEVLA9ofDMBgqzV8TBTCYlQ6aliJPxWALKO6VtriPPaYzk0rc75FvsNSBhgacmm2ui2IBUImGEd8OPil0esvbwbJxZUPwt8IR+8jpesW0nJuuUisT1Jv4nqutlq8/syhnM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=mxWUf6Ds; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3WgXJH+i; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=MN4ZyP3D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=hcbgHJ6s; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="mxWUf6Ds"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3WgXJH+i"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MN4ZyP3D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hcbgHJ6s" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 06D994D3ED; Wed, 18 Mar 2026 16:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773849787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lr/iSpFEtsFlvM7WU2EXJDEzTpLLAxsMUDdX2+LISb4=; b=mxWUf6DsIJx8JGLXtStpAvkupaCUrccGeP0yLQNCDkV4qUABh0+g/68xHwMl8H9fZIlZ4X L0hrfDspQ4SpJEkSChvwpeZf7GzCibji7C/ohFxEXSaHqMrmH4570sBezAku46b8UrmONm +rE30ohvX+WoMbcdxgX/KnKb+2JD05E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773849787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lr/iSpFEtsFlvM7WU2EXJDEzTpLLAxsMUDdX2+LISb4=; b=3WgXJH+i/W2VhI/OoEqstpeBhNlQBCfhbuaejfmnZhW8WSCSUKIzzekbobgY2vItM6rfdE vK44Na7AE+8zwqCA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773849785; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lr/iSpFEtsFlvM7WU2EXJDEzTpLLAxsMUDdX2+LISb4=; b=MN4ZyP3Djl9z16weZaFKFs6UKMQ/gJ7eEwCxwSTxJPwKz2XW/a8NVtlFIC+o540P0cRRrd +AwrLqfZqCHFPly1zuCLvDBwfOvYIraz8jNz9A/10nYp3kCgkglEajmTq6TivU1THDmMbf jYCvDuTOGS78AdsOxfxfRLqFBP25tos= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773849785; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lr/iSpFEtsFlvM7WU2EXJDEzTpLLAxsMUDdX2+LISb4=; b=hcbgHJ6s/LwKCT41IE7KEnBS4ecphnDTF0FRpq9zpCD3eIQ8LOBPkLeJf+J4dh30LZBWcK xaXzT9m2rACSzXCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BD1094273B; Wed, 18 Mar 2026 16:03:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iJv4LLjMummiRwAAD6G6ig (envelope-from ); Wed, 18 Mar 2026 16:03:04 +0000 Date: Wed, 18 Mar 2026 17:03:04 +0100 Message-ID: <871phhceh3.wl-tiwai@suse.de> From: Takashi Iwai To: =?ISO-8859-1?Q?C=E1ssio?= Gabriel Cc: Takashi Iwai , Jaroslav Kysela , Greg Kroah-Hartman , linux-sound@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Takashi Iwai Subject: Re: [PATCH v3] ALSA: usb-audio: validate full match when resolving quirk aliases In-Reply-To: <20260318-alsa-usb-fix-quirk-alias-v3-1-bd3b17a32939@gmail.com> References: <20260318-alsa-usb-fix-quirk-alias-v3-1-bd3b17a32939@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/30.2 Mule/6.0 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -3.30 X-Spam-Level: X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.996]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_TO(0.00)[gmail.com]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[8]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email] X-Spam-Flag: NO On Wed, 18 Mar 2026 15:08:46 +0100, Cássio Gabriel wrote: > > 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 > Signed-off-by: Cássio Gabriel > --- > Changes in v3: > - rework alias quirk matching as suggested by Takashi Iwai > - drop the explicit per-field helper > - keep the aliased vid:pid check first > - clear USB_DEVICE_ID_MATCH_DEVICE from a temporary id copy > - Link to v2: https://lore.kernel.org/r/20260317-alsa-usb-fix-quirk-alias-v2-1-6e531c67f0c8@gmail.com > > Changes in v2: > - drop the temporary usb_device_id reconstruction approach > - validate only the remaining match_flags explicitly > - pass struct usb_interface * to get_alias_quirk() > - Link to v1: https://lore.kernel.org/r/20260314-alsa-usb-fix-quirk-alias-v1-1-3269998f7ada@gmail.com Applied to for-next branch now. Thanks. Takashi