[PATCH OLK-5.10 0/2] ALSA: ctxfi: fix SPDIF1 mismatched
The previous fix addressed the crash symptom by adding a fallback index mapping for SPDIFI1 on hw20k2 devices. However, SPDIFI1 is a special DAIO type intended only for the hw20k1 CTSB073X model and should never be enumerated on hw20k2 in the first place. The real regression was introduced by the sparse DAIO mapping refactoring, which changed the DAIO initialization loop to iterate over all DAIOTYP entries, including SPDIFI1. As hw20k2 lacks a valid SPDIFI1 definition, this eventually led to invalid index handling and out-of-bounds access. Instead of adding special-case index handling for an invalid DAIO type, fix the root cause by skipping SPDIFI1 during generic DAIO enumeration and only mapping SPDIFIO to SPDIFI1 for the CTSB073X model as originally intended. With this change applied, the earlier workaround patch is no longer needed. Takashi Iwai (2): ALSA: ctxfi: Fix missing SPDIFI1 index handling ALSA: ctxfi: Don't enumerate SPDIF1 at DAIO initialization sound/pci/ctxfi/ctatc.c | 8 ++++++-- sound/pci/ctxfi/ctdaio.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) -- 2.22.0
From: Takashi Iwai <tiwai@suse.de> mainline inclusion from mainline-v7.0-rc7 commit b045ab3dff97edae6d538eeff900a34c098761f8 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14530 CVE: CVE-2026-31776 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- SPDIF1 DAIO type isn't properly handled in daio_device_index() for hw20k2, and it returned -EINVAL, which ended up with the out-of-bounds array access. Follow the hw20k1 pattern and return the proper index for this type, too. Reported-and-tested-by: Karsten Hohmeier <linux@hohmatik.de> Closes: https://lore.kernel.org/20260315155004.15633-1-linux@hohmatik.de Cc: <stable@vger.kernel.org> Link: https://patch.msgid.link/20260329091240.420194-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Zhang Yuwei <zhangyuwei20@huawei.com> --- sound/pci/ctxfi/ctdaio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index aae544dff886..11cb0d886e95 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c @@ -119,6 +119,7 @@ static unsigned int daio_device_index(enum DAIOTYP type, struct hw *hw) switch (type) { case SPDIFOO: return 0; case SPDIFIO: return 0; + case SPDIFI1: return 1; case LINEO1: return 4; case LINEO2: return 7; case LINEO3: return 5; -- 2.22.0
From: Takashi Iwai <tiwai@suse.de> mainline inclusion from mainline-v7.0-rc7 commit 75dc1980cf48826287e43dc7a49e310c6691f97e category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14530 CVE: CVE-2026-31776 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- The recent refactoring of xfi driver changed the assignment of atc->daios[] at atc_get_resources(); now it loops over all enum DAIOTYP entries while it looped formerly only a part of them. The problem is that the last entry, SPDIF1, is a special type that is used only for hw20k1 CTSB073X model (as a replacement of SPDIFIO), and there is no corresponding definition for hw20k2. Due to the lack of the info, it caused a kernel crash on hw20k2, which was already worked around by the commit b045ab3dff97 ("ALSA: ctxfi: Fix missing SPDIFI1 index handling"). This patch addresses the root cause of the regression above properly, simply by skipping the incorrect SPDIF1 type in the parser loop. For making the change clearer, the code is slightly arranged, too. Fixes: a2dbaeb5c61e ("ALSA: ctxfi: Refactor resource alloc for sparse mappings") Cc: <stable@vger.kernel.org> Link: https://bugzilla.suse.com/show_bug.cgi?id=1259925 Link: https://patch.msgid.link/20260331081227.216134-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Conflicts: sound/pci/ctxfi/ctatc.c [commit 9b4a22733c156 not merged] --- sound/pci/ctxfi/ctatc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 06775519dab0..21f18cc586ab 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1396,8 +1396,12 @@ static int atc_get_resources(struct ct_atc *atc) daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO]; da_desc.msr = atc->msr; for (i = 0, atc->n_daio = 0; i < num_daios; i++) { - da_desc.type = (atc->model != CTSB073X) ? i : - ((i == SPDIFIO) ? SPDIFI1 : i); + if (i == SPDIFI1) + continue; + if (atc->model == CTSB073X && i == SPDIFIO) + da_desc.type = SPDIFI1; + else + da_desc.type = i; err = daio_mgr->get_daio(daio_mgr, &da_desc, (struct daio **)&atc->daios[i]); if (err) { -- 2.22.0
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/22429 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/47N... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/22429 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/47N...
participants (2)
-
patchwork bot -
Zhang Yuwei