From 2ef8e86f44112b68cc7c779acbae8d6dfa9cb4af Mon Sep 17 00:00:00 2001 From: maoyanping Date: Thu, 17 Apr 2025 16:13:46 +0800 Subject: [PATCH] fix CVE-2024-46981 reference:https://github.com/redis/redis/pull/13728/files Signed-off-by: maoyanping --- fix-CVE-2024-46981.patch | 24 ++++++++++++++++++++++++ redis6.spec | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 fix-CVE-2024-46981.patch diff --git a/fix-CVE-2024-46981.patch b/fix-CVE-2024-46981.patch new file mode 100644 index 0000000..5dd139a --- /dev/null +++ b/fix-CVE-2024-46981.patch @@ -0,0 +1,24 @@ +From ff795563a1fc093b655ca81cd62f80cbf8d1cd13 Mon Sep 17 00:00:00 2001 +From: maoyanping +Date: Thu, 17 Apr 2025 16:10:20 +0800 +Subject: [PATCH] fix-CVE-2024-46981 + +--- + src/scripting.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/scripting.c b/src/scripting.c +index 0f6af7a..6f570bd 100644 +--- a/src/scripting.c ++++ b/src/scripting.c +@@ -1493,6 +1493,7 @@ void scriptingRelease(int async) { + else + dictRelease(server.lua_scripts); + server.lua_scripts_mem = 0; ++ lua_gc(server.lua, LUA_GCCOLLECT, 0); + lua_close(server.lua); + } + +-- +2.33.0 + diff --git a/redis6.spec b/redis6.spec index b291431..1fdff3d 100644 --- a/redis6.spec +++ b/redis6.spec @@ -6,7 +6,7 @@ %global Pname redis Name: redis6 Version: 6.2.7 -Release: 3 +Release: 4 Summary: A persistent key-value database License: BSD and MIT URL: https://redis.io @@ -25,6 +25,7 @@ Patch0003: Add-loongarch64-support.patch Patch0004: Update-config.guess-and-config.sub.patch Patch0002: fix-help-info.patch +Patch0005: fix-CVE-2024-46981.patch BuildRequires: make gcc %if %{with tests} BuildRequires: procps-ng tcl @@ -91,6 +92,7 @@ tar -xvf %{SOURCE10} %patch0003 -p1 %patch0004 -p1 %endif +%patch0005 -p1 mv ../%{Pname}-doc-%{doc_commit} doc mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc @@ -219,6 +221,9 @@ fi %{_docdir}/%{Pname} %changelog +* Thu Apr 17 2025 maoyanping - 6.2.7-4 +- Backport to fix CVE-2024-46981 + * Wed Apr 10 2024 jiangxinyu - 6.2.7-3 - add Conflicts with redis and redis5 -- Gitee