Skip to content

Commit 693cb87

Browse files
[AutoPR- Security] Patch memcached for CVE-2026-24809 [MEDIUM] (#15615)
1 parent 0e55d09 commit 693cb87

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 3bb38d48f5e04d56ff7e08391dd17f902e7828ff Mon Sep 17 00:00:00 2001
2+
From: npt-1707 <npthanh132@gmail.com>
3+
Date: Mon, 21 Apr 2025 23:05:53 +0800
4+
Subject: [PATCH] Save stack space while handling errors
5+
6+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
7+
Upstream-reference: https://github.com/praydog/REFramework/pull/1320.patch
8+
---
9+
vendor/lua/src/ldebug.c | 5 ++++-
10+
vendor/lua/src/lvm.c | 6 ++++--
11+
2 files changed, 8 insertions(+), 3 deletions(-)
12+
13+
diff --git a/vendor/lua/src/ldebug.c b/vendor/lua/src/ldebug.c
14+
index 1feaab2..5524fae 100644
15+
--- a/vendor/lua/src/ldebug.c
16+
+++ b/vendor/lua/src/ldebug.c
17+
@@ -783,8 +783,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
18+
va_start(argp, fmt);
19+
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
20+
va_end(argp);
21+
- if (isLua(ci)) /* if Lua function, add source:line information */
22+
+ if (isLua(ci)) { /* if Lua function, add source:line information */
23+
luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
24+
+ setobjs2s(L, L->top - 2, L->top - 1); /* remove 'msg' from the stack */
25+
+ L->top--;
26+
+ }
27+
luaG_errormsg(L);
28+
}
29+
30+
diff --git a/vendor/lua/src/lvm.c b/vendor/lua/src/lvm.c
31+
index c9729bc..51b9614 100644
32+
--- a/vendor/lua/src/lvm.c
33+
+++ b/vendor/lua/src/lvm.c
34+
@@ -656,8 +656,10 @@ void luaV_concat (lua_State *L, int total) {
35+
/* collect total length and number of strings */
36+
for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
37+
size_t l = vslen(s2v(top - n - 1));
38+
- if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl))
39+
+ if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) {
40+
+ L->top = top - total; /* pop strings to avoid wasting stack */
41+
luaG_runerror(L, "string length overflow");
42+
+ }
43+
tl += l;
44+
}
45+
if (tl <= LUAI_MAXSHORTLEN) { /* is result a short string? */
46+
@@ -672,7 +674,7 @@ void luaV_concat (lua_State *L, int total) {
47+
setsvalue2s(L, top - n, ts); /* create result */
48+
}
49+
total -= n-1; /* got 'n' strings to create 1 new */
50+
- L->top -= n-1; /* popped 'n' strings and pushed one */
51+
+ L->top = top - (n - 1); /* popped 'n' strings and pushed one */
52+
} while (total > 1); /* repeat until only 1 result left */
53+
}
54+
55+
--
56+
2.45.4
57+

SPECS/memcached/memcached.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Summary: High Performance, Distributed Memory Object Cache
88
Name: memcached
99
Version: 1.6.27
10-
Release: 3%{?dist}
10+
Release: 4%{?dist}
1111
License: BSD
1212
Vendor: Microsoft Corporation
1313
Distribution: Azure Linux
@@ -17,6 +17,7 @@ Source1: memcached.sysconfig
1717
Patch0: memcached-unit.patch
1818
Patch1: CVE-2021-43519.patch
1919
Patch2: CVE-2021-44647.patch
20+
Patch3: CVE-2026-24809.patch
2021
BuildRequires: gcc
2122
BuildRequires: libevent-devel
2223
BuildRequires: systemd-devel
@@ -131,6 +132,9 @@ exit 0
131132
%{_unitdir}/memcached.service
132133

133134
%changelog
135+
* Thu Jan 29 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.6.27-4
136+
- Patch for CVE-2026-24809
137+
134138
* Thu Mar 20 2025 Jyoti Kanase <v-jykanase@microsoft.com> - 1.6.27-3
135139
- Fix CVE-2023-6228
136140

0 commit comments

Comments
 (0)