Skip to content

Commit acf7ffc

Browse files
[AUTO-CHERRYPICK] [AutoPR- Security] Patch luajit for CVE-2024-25178, CVE-2024-25176 [HIGH] - branch main (microsoft#14347)
Co-authored-by: Azure Linux Security Servicing Account <[email protected]>
1 parent 8c1af23 commit acf7ffc

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

SPECS/luajit/CVE-2024-25176.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 89b607c36aeccb3ed78f6c509747b255f3441cd7 Mon Sep 17 00:00:00 2001
2+
From: Azure Linux Security Servicing Account
3+
4+
Date: Thu, 17 Jul 2025 08:57:04 +0000
5+
Subject: [PATCH] Fix CVE CVE-2024-25176 in luajit
6+
7+
Upstream Patch Reference: https://github.com/LuaJIT/LuaJIT/commit/343ce0edaf3906a62022936175b2f5410024cbfc.patch
8+
---
9+
src/lj_strfmt_num.c | 3 ++-
10+
1 file changed, 2 insertions(+), 1 deletion(-)
11+
12+
diff --git a/src/lj_strfmt_num.c b/src/lj_strfmt_num.c
13+
index 9271f68..1d4fc7c 100644
14+
--- a/src/lj_strfmt_num.c
15+
+++ b/src/lj_strfmt_num.c
16+
@@ -454,7 +454,8 @@ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p)
17+
prec--;
18+
if (!i) {
19+
if (ndlo == ndhi) { prec = 0; break; }
20+
- lj_strfmt_wuint9(tail, nd[++ndlo]);
21+
+ ndlo = (ndlo + 1) & 0x3f;
22+
+ lj_strfmt_wuint9(tail, nd[ndlo]);
23+
i = 9;
24+
}
25+
}
26+
--
27+
2.45.3
28+

SPECS/luajit/CVE-2024-25178.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 830d971585c64132da43f722e563d1557f94eb9b Mon Sep 17 00:00:00 2001
2+
From: Azure Linux Security Servicing Account
3+
4+
Date: Thu, 17 Jul 2025 08:57:12 +0000
5+
Subject: [PATCH] Fix CVE CVE-2024-25178 in luajit
6+
7+
Upstream Patch Reference: https://github.com/LuaJIT/LuaJIT/commit/defe61a56751a0db5f00ff3ab7b8f45436ba74c8.patch
8+
---
9+
src/lj_debug.c | 1 +
10+
1 file changed, 1 insertion(+)
11+
12+
diff --git a/src/lj_debug.c b/src/lj_debug.c
13+
index 959dc28..11fe3f1 100644
14+
--- a/src/lj_debug.c
15+
+++ b/src/lj_debug.c
16+
@@ -63,6 +63,7 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
17+
if (cf == NULL || (char *)cframe_pc(cf) == (char *)cframe_L(cf))
18+
return NO_BCPOS;
19+
ins = cframe_pc(cf); /* Only happens during error/hook handling. */
20+
+ if (!ins) return NO_BCPOS;
21+
} else {
22+
if (frame_islua(nextframe)) {
23+
ins = frame_pc(nextframe);
24+
--
25+
2.45.3
26+

SPECS/luajit/luajit.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name: luajit
55
Version: 2.1.0
66
%global apiver %(v=%{version}; echo ${v%.${v#[0-9].[0-9].}})
77
%global srcver %{version}%{?rctag:-%{rctag}}
8-
Release: 26%{?dist}
8+
Release: 27%{?dist}
99
License: MIT
1010
Vendor: Microsoft Corporation
1111
Distribution: Mariner
@@ -19,6 +19,8 @@ Patch0: luajit-2.1-update.patch
1919
# Patches from https://github.com/cryptomilk/LuaJIT/commits/v2.1-fedora
2020
# git format-patch --stdout -l1 --no-renames v2.1..v2.1-fedora > luajit-2.1-fedora.patch
2121
Patch1: luajit-2.1-fedora.patch
22+
Patch2: CVE-2024-25178.patch
23+
Patch3: CVE-2024-25176.patch
2224

2325
BuildRequires: gcc
2426
BuildRequires: make
@@ -94,6 +96,9 @@ make check || true
9496
%{_libdir}/pkgconfig/%{name}.pc
9597

9698
%changelog
99+
* Thu Jul 17 2025 Azure Linux Security Servicing Account <[email protected]> - 2.1.0-27
100+
- Patch for CVE-2024-25178, CVE-2024-25176
101+
97102
* Fri Jan 27 2023 Suresh Babu Chalamalasetty <[email protected]> - 2.1.0-26
98103
- Initial CBL-Mariner import from Fedora 38 (license: MIT).
99104
- Verified license.

0 commit comments

Comments
 (0)