From 33df3bedc7822dcfb9aa8ea3cd13e5796828a7dc Mon Sep 17 00:00:00 2001 From: zhoupengcheng Date: Mon, 6 May 2024 17:22:19 +0800 Subject: [PATCH] fix CVE-2024-27282 --- backport-CVE-2024-27282.patch | 31 +++++++++++++++++++++++++++++++ ruby.spec | 6 +++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2024-27282.patch diff --git a/backport-CVE-2024-27282.patch b/backport-CVE-2024-27282.patch new file mode 100644 index 0000000..1ecd087 --- /dev/null +++ b/backport-CVE-2024-27282.patch @@ -0,0 +1,31 @@ +From 989a2355808a63fc45367785c82ffd46d18c900a Mon Sep 17 00:00:00 2001 +From: Hiroshi SHIBATA +Date: Fri, 12 Apr 2024 15:01:47 +1000 +Subject: [PATCH] Fix Use-After-Free issue for Regexp + +Co-authored-by: Isaac Peka <7493006+isaac-peka@users.noreply.github.com> + + +Reference:https://github.com/ruby/rdoc/commit/989a2355808a63fc45367785c82ffd46d18c900a +Conflict:NA +--- + regexec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/regexec.c b/regexec.c +index 73694ab14a..140691ad42 100644 +--- a/regexec.c ++++ b/regexec.c +@@ -3449,8 +3449,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, + CASE(OP_MEMORY_END_PUSH_REC) MOP_IN(OP_MEMORY_END_PUSH_REC); + GET_MEMNUM_INC(mem, p); + STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */ +- STACK_PUSH_MEM_END(mem, s); + mem_start_stk[mem] = GET_STACK_INDEX(stkp); ++ STACK_PUSH_MEM_END(mem, s); + MOP_OUT; + JUMP; + +-- +2.33.0 + diff --git a/ruby.spec b/ruby.spec index 5da67c9..818b263 100644 --- a/ruby.spec +++ b/ruby.spec @@ -33,7 +33,7 @@ Name: ruby Version: %{ruby_version} -Release: 132 +Release: 133 Summary: Object-oriented scripting language interpreter License: (Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD URL: https://www.ruby-lang.org/en/ @@ -192,6 +192,7 @@ Patch6020: backport-CVE-2024-27280.patch Patch6021: backport-0001-CVE-2024-27281.patch Patch6022: backport-0002-CVE-2024-27281.patch Patch6023: backport-0003-CVE-2024-27281.patch +Patch6024: backport-CVE-2024-27282.patch Provides: %{name}-libs = %{version}-%{release} Obsoletes: %{name}-libs < %{version}-%{release} @@ -1190,6 +1191,9 @@ make runruby TESTRUN_SCRIPT=%{SOURCE13} %doc %{gem_dir}/gems/typeprof-%{typeprof_version}/testbed %changelog +* Mon May 6 2024 zhoupengcheng11 - 3.0.3-133 +- fix CVE-2024-27282 + * Tue Mar 26 2024 shixuantong - 3.0.3-132 - fix CVE-2024-27280 and CVE-2024-27281 -- Gitee