Open
fix(cve): 修复 CVE-2026-111166 在 libmikmod 中的漏洞 #51
fix(cve): 修复 CVE-2026-111166 在 libmikmod 中的漏洞 #51
Open
ljtianAdd on 2 days ago
Total: 2 files changed+46-1
@@ -0,0 +1,41 @@
1+From b5f742e4e995d7503efee695ef26f275bba4c938 Mon Sep 17 00:00:00 2001
2+From: Ozkan Sezer <sezeroz@gmail.com>
3+Date: Sun, 25 Oct 2026 20:02:10 +0000
4+Subject: [PATCH] load_imf.c: fix wrong index to samplenote for UF_LINEAR case
5+ 
6+load_imf.c: fix wrong index to samplenote for UF_LINEAR case.
7+ 
8+(Looks like it was a copy/paste mistake from the IT loader..)
9+ 
10+The loop that walks the notes of an instrument is indexed by t, but for
11+modules with the linear-period flag (UF_LINEAR) the note was computed from
12+samplenote[u]/samplenumber[u], where u is the instrument index. With an
13+IMF module declaring more instruments than IMFNOTECNT entries, u runs past
14+the instrument note table, so a crafted module triggers a heap out-of-bounds
15+read while loading. Use the note index t as intended.
16+ 
17+Fixes CVE-2026-111166
18+ 
19+Upstream-commit: https://github.com/sezero/mikmod/commit/b5f742e4e995d7503efee695ef26f275bba4c938
20+Signed-off-by: tianlijun <tianlijun@uniontech.com>
21+---
22+ loaders/load_imf.c | 4 ++--
23+ 1 file changed, 2 insertions(+), 2 deletions(-)
24+ 
25+diff --git a/loaders/load_imf.c b/loaders/load_imf.c
26+index 118fe5e..5cccb08 100644
27+--- a/loaders/load_imf.c
28++++ b/loaders/load_imf.c
29+@@ -727,8 +727,8 @@ static BOOL IMF_Load(BOOL curious)
30+ if(d->samplenumber[t]>=of.numsmp)
31+ d->samplenote[t]=255;
32+ else if (of.flags&UF_LINEAR) {
33+- int note=(int)d->samplenote[u]+noteindex[d->samplenumber[u]];
34+- d->samplenote[u]=(note<0)?0:(note>255?255:note);
35++ int note=(int)d->samplenote[t]+noteindex[d->samplenumber[t]];
36++ d->samplenote[t]=(note<0)?0:(note>255?255:note);
37+ } else
38+ d->samplenote[t]=t;
39+ }
40+--
41+2.53.0
@@ -1,6 +1,6 @@
1Name: libmikmod1Name: libmikmod
2Version: 3.3.11.12Version: 3.3.11.1
3-Release: 93+Release: 10
4Summary: MOD Music File Player library4Summary: MOD Music File Player library
5License: GPLv2 and LGPLv2+5License: GPLv2 and LGPLv2+
6URL: http://mikmod.sourceforge.net/6URL: http://mikmod.sourceforge.net/
@@ -9,6 +9,7 @@ Patch0001: libmikmod-64bit.patch
9Patch0002: libmikmod-multilib.patch9Patch0002: libmikmod-multilib.patch
10Patch0003: libmikmod-cflags.patch10Patch0003: libmikmod-cflags.patch
11Patch0004: libmikmod-CVE-2026-105838.patch11Patch0004: libmikmod-CVE-2026-105838.patch
12+Patch0005: libmikmod-CVE-2026-111166.patch
12BuildRequires: alsa-lib-devel pulseaudio-libs-devel gcc13BuildRequires: alsa-lib-devel pulseaudio-libs-devel gcc
13 14 
14%description15%description
@@ -68,6 +69,9 @@ Files for help with libmikmod.
68%{_mandir}/man1/%{name}-config*69%{_mandir}/man1/%{name}-config*
69 70 
70%changelog71%changelog
72+* Tue Nov 17 2026 tianlijun <tianlijun@uniontech.com> - 3.3.11.1-10
73+- Fix CVE-2026-111166: heap out-of-bounds read in IMF loader with UF_LINEAR flag (load_imf.c, backport upstream b5f742e4)
74+ 
71* Tue Oct 20 2026 infra_team <zhaiwenjie1@huawei.com> - 3.3.11.1-975* Tue Oct 20 2026 infra_team <zhaiwenjie1@huawei.com> - 3.3.11.1-9
72- Fix CVE-2026-105838: heap out-of-bounds read in IT module loader (load_it.c itpat 200->256, backport upstream e7c6c9e8)76- Fix CVE-2026-105838: heap out-of-bounds read in IT module loader (load_it.c itpat 200->256, backport upstream e7c6c9e8)
73 77