From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D5A648D88E; Sat, 12 Sep 2026 19:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789240355; cv=none; b=IZft3YZxMdPPw1gX1M7Sl0U5v2xSQvLWIU1F0Ewk5fzLXgc/HenzV/99Ju6Eh6DHcdFWBsPumvrrfTLYW5jYEFpq8qWbR1tYfUOPyJUA7qQZ3wQw6Oyx3UkHUVTr/PnX1Q98i7FY4jKGR1WCDnU261+0cci7aR+RvOpajHAZPyQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789240355; c=relaxed/simple; bh=tbLSGjyeEsHduI1dLaU2jWbXH4T4m4m1fUIxmDULo1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KY+tnpNo/CCOndshBlZIDS4yPjXuanZkdPvWVymlyAwcb5A4SIt3rEkrThUl463VB+EBrChw9v+TaT490x1G2llm9gX0bzp++L9Cy5jqBkpDdPOl9iNAUuMtjsBL8/10lKg6kycF/SSHx+PnSp0LyxkGFW6BSdejAOZ7+YXvYnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vtpDGWb0; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vtpDGWb0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4EC01F0089D; Sat, 12 Sep 2026 19:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789240354; bh=JDYpJ0KjkXsO0L0Y+tA/U0pPO5YG0iEuxHzA3MLzJ0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vtpDGWb0BzAEe9Kw6l0znt8znGEGOaWRI7KnkUdYHtY5nHFn/sRCoEcue19XdM2zr lA9/leLIQgFJUUTOo3fllnzq7blAdw5NoC8wpM4DEbVM4x5cwWHuhoRIKsF+r7In2q bpRc9Z+HVcKSPmM5O2V5MEAx7b2PfKJguh9BpYZU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xu Rao , Takashi Iwai , Sasha Levin Subject: [PATCH 5.15 850/935] ALSA: hda: Fix connection list comparison in proc output Date: Sat, 12 Sep 2026 09:04:40 +0200 Message-ID: <20260912065546.323544241@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xu Rao [ Upstream commit c139e7e44f58a6f8ddc9d850ea9924d34963b5da ] print_conn_list() compares the raw hardware connection list with the connection list cached by the HDA driver. When they differ, it prints an additional "In-driver Connection" line so that /proc/asound/card*/codec#* shows the topology actually used by the driver. The comparison currently passes conn_len directly to memcmp(). However, conn_len is a number of connection-list entries, while memcmp() expects a size in bytes. Both list and conn are arrays of hda_nid_t, which is u16, so only half of the connection data is compared. For example, for two-entry lists such as: hardware: 0x0c 0x0d cached: 0x0c 0x0e conn_len is 2, and the current comparison checks only the first hda_nid_t. The lists are therefore incorrectly treated as identical even though the second connection differs. This can happen legitimately when codec fixups replace a cached connection list with snd_hda_override_conn_list(). The codec routing used by the driver is not affected, but the proc output can hide the overridden driver-visible routing and provide misleading topology information during codec debugging. Convert the entry count to a byte size so that memcmp() covers the complete connection list. Fixes: 8b2c7a5c404d ("ALSA: hda - Add In-driver connection info") Signed-off-by: Xu Rao Link: https://patch.msgid.link/7B802A4E225CC808+20260818083808.2735120-1-raoxu@uniontech.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/hda_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 00c2eeb2c472d..e8a4cf3c84d82 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -624,7 +624,7 @@ static void print_conn_list(struct snd_info_buffer *buffer, /* Get Cache connections info */ cache_len = snd_hda_get_conn_list(codec, nid, &list); if (cache_len >= 0 && (cache_len != conn_len || - memcmp(list, conn, conn_len) != 0)) { + memcmp(list, conn, conn_len * sizeof(*conn)) != 0)) { snd_iprintf(buffer, " In-driver Connection: %d\n", cache_len); if (cache_len > 0) { snd_iprintf(buffer, " "); -- 2.53.0