Skip to contentSkip to conversation

luajit: fix several CVEs

PATCH New [email protected] 1 participant 1 message Aug 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 luajit: fix several CVEs

From: Changqing Li <[email protected]>

Fix CVE-2024-25176, CVE-2024-25177, CVE-2024-25178

---
 .../luajit/luajit/CVE-2024-25176.patch        |  32 ++++
 .../luajit/luajit/CVE-2024-25177.patch        |  47 +++++
 .../luajit/luajit/CVE-2024-25178.patch        | 162 ++++++++++++++++++
 meta-oe/recipes-devtools/luajit/luajit_git.bb |   3 +
 4 files changed, 244 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/luajit/luajit/CVE-2024-25176.patch
 create mode 100644 meta-oe/recipes-devtools/luajit/luajit/CVE-2024-25177.patch
 create mode 100644 meta-oe/recipes-devtools/luajit/luajit/CVE-2024-25178.patch
meta-oe/recipes-devtools/luajit/luajit/CVE-2024-25176.patch new file +32 -0
new file mode 100644
index 0000000000..5d3048e05f
@@ -0,0 +1,32 @@
+From fd92fb62201b3980af8e538452102e9f21426ec6 Mon Sep 17 00:00:00 2001
+From: Mike Pall <mike>
+Date: Thu, 25 Jan 2024 13:23:48 +0100
+Subject: [PATCH] Fix zero stripping in %g number formatting.
+
+Reported by pwnhacker0x18. #1149
+
+CVE: CVE-2024-25176
+Upstream-Status: Backport [https://github.com/LuaJIT/LuaJIT/commit/343ce0edaf3906a62022936175b2f5410024cbfc]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ src/lj_strfmt_num.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lj_strfmt_num.c b/src/lj_strfmt_num.c
+index 79ec0263..c6e776aa 100644
+--- a/src/lj_strfmt_num.c
++++ b/src/lj_strfmt_num.c
+@@ -454,7 +454,8 @@ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p)
+ 	    prec--;
+ 	    if (!i) {
+ 	      if (ndlo == ndhi) { prec = 0; break; }
+-	      lj_strfmt_wuint9(tail, nd[++ndlo]);
++	      ndlo = (ndlo + 1) & 0x3f;
++	      lj_strfmt_wuint9(tail, nd[ndlo]);
+ 	      i = 9;
+ 	    }
+ 	  }
+-- 
+2.34.1
+
meta-oe/recipes-devtools/luajit/luajit/CVE-2024-25177.patch new file +47 -0

47 lines not on this page · raw message

meta-oe/recipes-devtools/luajit/luajit/CVE-2024-25178.patch new file +162 -0

162 lines not on this page · raw message

meta-oe/recipes-devtools/luajit/luajit_git.bb +3 -0
index 240271d410..507d254556 100644
@@ -6,6 +6,9 @@ HOMEPAGE = "http://luajit.org"
 SRC_URI = "git://luajit.org/git/luajit-2.0.git;protocol=http;branch=v2.1 \
            file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \
            file://0001-Use-builtin-for-clear_cache.patch \
+           file://CVE-2024-25177.patch \
+           file://CVE-2024-25176.patch \
+           file://CVE-2024-25178.patch \
            "
 
 PV = "2.1"
Signature · 1 line
2.34.1