Skip to content

Commit 468a249

Browse files
Kanishk-BansalsameluchKavyaSree2610jslobodzian
committed
Patch memcached for CVE-2021-43519 (#12229)
Co-authored-by: Sam Meluch <[email protected]> Co-authored-by: KavyaSree2610 <[email protected]> Co-authored-by: jslobodzian <[email protected]>
1 parent 1a7c9a7 commit 468a249

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

SPECS/memcached/CVE-2021-43519.patch

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 1bab87b86d590c50057a5c3b48a00caf1cff807e Mon Sep 17 00:00:00 2001
2+
From: Kanishk Bansal <[email protected]>
3+
Date: Wed, 5 Feb 2025 09:27:34 +0000
4+
Subject: [PATCH] Address CVE-2021-43519
5+
6+
---
7+
vendor/lua/src/ldo.c | 6 ++++--
8+
1 file changed, 4 insertions(+), 2 deletions(-)
9+
10+
diff --git a/vendor/lua/src/ldo.c b/vendor/lua/src/ldo.c
11+
index 7135079..ca558fd 100644
12+
--- a/vendor/lua/src/ldo.c
13+
+++ b/vendor/lua/src/ldo.c
14+
@@ -728,11 +728,10 @@ static void resume (lua_State *L, void *ud) {
15+
StkId firstArg = L->top - n; /* first argument */
16+
CallInfo *ci = L->ci;
17+
if (L->status == LUA_OK) /* starting a coroutine? */
18+
- ccall(L, firstArg - 1, LUA_MULTRET, 1); /* just call its body */
19+
+ ccall(L, firstArg - 1, LUA_MULTRET, 0); /* just call its body */
20+
else { /* resuming from previous yield */
21+
lua_assert(L->status == LUA_YIELD);
22+
L->status = LUA_OK; /* mark that it is running (again) */
23+
- luaE_incCstack(L); /* control the C stack */
24+
if (isLua(ci)) { /* yielded inside a hook? */
25+
L->top = firstArg; /* discard arguments */
26+
luaV_execute(L, ci); /* just continue running Lua code */
27+
@@ -783,6 +782,9 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs,
28+
else if (L->status != LUA_YIELD) /* ended with errors? */
29+
return resume_error(L, "cannot resume dead coroutine", nargs);
30+
L->nCcalls = (from) ? getCcalls(from) : 0;
31+
+ if (getCcalls(L) >= LUAI_MAXCCALLS)
32+
+ return resume_error(L, "C stack overflow", nargs);
33+
+ L->nCcalls++;
34+
luai_userstateresume(L, nargs);
35+
api_checknelems(L, (L->status == LUA_OK) ? nargs + 1 : nargs);
36+
status = luaD_rawrunprotected(L, resume, &nargs);
37+
--
38+
2.43.0
39+

SPECS/memcached/memcached.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
Summary: High Performance, Distributed Memory Object Cache
88
Name: memcached
99
Version: 1.6.27
10-
Release: 1%{?dist}
10+
Release: 2%{?dist}
1111
License: BSD
1212
Vendor: Microsoft Corporation
1313
Distribution: Azure Linux
1414
URL: https://www.memcached.org/
1515
Source0: https://www.memcached.org/files/%{name}-%{version}.tar.gz
1616
Source1: memcached.sysconfig
1717
Patch0: memcached-unit.patch
18+
Patch1: CVE-2021-43519.patch
1819
BuildRequires: gcc
1920
BuildRequires: libevent-devel
2021
BuildRequires: systemd-devel
@@ -129,6 +130,9 @@ exit 0
129130
%{_unitdir}/memcached.service
130131

131132
%changelog
133+
* Wed Feb 05 2025 Kanishk Bansal <[email protected]> - 1.6.27-2
134+
- Address CVE-2021-43519
135+
132136
* Wed May 08 2024 Osama Esmail <[email protected]> - 1.6.27-1
133137
- Upgrading to 1.6.27
134138
- Separating out memcached-service into a subpackage

0 commit comments

Comments
 (0)