[packages/ruby/DEVEL-3.4] Up to 3.4.12

arekm arekm at pld-linux.org
Thu Oct 29 09:43:27 CET 2026


commit b0b42d5df9b776d5e57d32a6c0a05899f0cfe84b
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 09:26:41 2026 +0100

    Up to 3.4.12
    
    Fixes CVE-2026-80213, CVE-2026-80212, CVE-2026-54696, CVE-2026-47242,
    CVE-2026-47241, CVE-2026-47240, CVE-2026-42258, CVE-2026-42257,
    CVE-2026-42256, CVE-2026-42246, CVE-2026-42245, CVE-2026-41316.

 CVE-2026-54696.patch | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++
 ruby.spec            |  18 ++++----
 2 files changed, 125 insertions(+), 8 deletions(-)
---
diff --git a/ruby.spec b/ruby.spec
index e2b99cd..0afb9fc 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -13,9 +13,9 @@
 %define		with_yjit	1
 %endif
 
-%define		rel		9
+%define		rel		1
 %define		ruby_version	3.4
-%define		patchlevel	9
+%define		patchlevel	12
 %define		pkg_version	%{ruby_version}.%{patchlevel}
 %define		ruby_suffix	%{!?with_default_ruby:%{ruby_version}}
 %define		doc_version	3_4_1
@@ -38,7 +38,7 @@ License:	(Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD
 Group:		Development/Languages
 # https://www.ruby-lang.org/en/downloads/
 Source0:	https://cache.ruby-lang.org/pub/ruby/%{ruby_version}/%{oname}-%{pkg_version}.tar.xz
-# Source0-md5:	b58158f56343125bc9a56841f4c2cb35
+# Source0-md5:	db791b0520a57d2dbab52fd07a266f7c
 Source2:	https://ruby-doc.org/downloads/%{oname}_%{doc_version}_complete_rdocs.tgz
 # Source2-md5:	a13c63951d5ce47b169935a7208f876d
 Source6:	operating_system.rb
@@ -47,6 +47,7 @@ Patch5:		ruby-version.patch
 Patch6:		duplicated-paths.patch
 Patch9:		custom-rubygems-location.patch
 Patch12:	archlibdir.patch
+Patch13:	CVE-2026-54696.patch
 URL:		http://www.ruby-lang.org/
 BuildRequires:	autoconf >= 2.67
 BuildRequires:	automake
@@ -54,7 +55,6 @@ BuildRequires:  gcc-c++
 BuildRequires:	gmp-devel
 BuildRequires:	libffi-devel
 BuildRequires:	libstdc++-devel
-BuildRequires:	ncurses-devel
 BuildRequires:	openssl-devel >= 0.9.6
 BuildRequires:	pkgconfig
 BuildRequires:	rpm-build >= 5.4.10-49
@@ -104,11 +104,11 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define bundler_uri_ver 1.0.4
 
 %define did_you_mean_ver 2.0.0
-%define erb_ver 4.0.4
+%define erb_ver 4.0.4.1
 %define io_console_ver 0.8.1
 %define irb_ver 1.14.3
 %define json_ver 2.9.1
-%define openssl_ver 3.3.1
+%define openssl_ver 3.3.3
 %define psych_ver 5.2.2
 %define rdoc_ver 6.14.0
 %define stringio_ver 3.1.2
@@ -122,7 +122,7 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define rexml_ver 3.4.4
 %define rss_ver 0.3.1
 %define net_ftp_ver 0.3.8
-%define net_imap_ver 0.5.8
+%define net_imap_ver 0.5.15
 %define net_pop_ver 0.1.2
 %define net_smtp_ver 0.5.1
 %define matrix_ver 0.4.2
@@ -642,6 +642,7 @@ don't get access to features such as XPath.
 %package rss
 Summary:	Family of libraries that support various formats of XML "feeds"
 Version:	%{rss_ver}
+Epoch:		2
 License:	BSD
 URL:		https://github.com/ruby/rss
 BuildArch:	noarch
@@ -690,6 +691,7 @@ these needs to be listed in Gemfile to be used by Bundler.
 %patch 6 -p1
 %patch 9 -p1
 %patch 12 -p1
+%patch 13 -p1
 
 # must be regenerated with new bison
 %{__rm} parse.{c,h}
@@ -1038,7 +1040,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc NEWS.md LEGAL BSDL README.md README.EXT ChangeLog
+%doc NEWS.md LEGAL BSDL README.md README.EXT
 %attr(755,root,root) %{_bindir}/ruby%{ruby_suffix}
 %attr(755,root,root) %{_libdir}/libruby.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libruby.so.%{ruby_version}
diff --git a/CVE-2026-54696.patch b/CVE-2026-54696.patch
new file mode 100644
index 0000000..751b994
--- /dev/null
+++ b/CVE-2026-54696.patch
@@ -0,0 +1,115 @@
+generator.c: don't start with a stack buffer in IO case
+Fixes a heap buffer overflow in JSON.dump(obj, io) / JSON::State#generate(obj, io).
+CVE-2026-54696; ruby/json fd6a65bd08 adapted to the json 2.9.1 bundled with Ruby 3.4
+(the parser still uses fbuffer_stack_init, so the IO-aware init is generator-only):
+https://github.com/ruby/json/commit/fd6a65bd08e5f3a429c03919ebfd8dd19158f095
+
+--- a/ext/json/fbuffer/fbuffer.h
++++ b/ext/json/fbuffer/fbuffer.h
+@@ -81,6 +81,18 @@
+     }
+ }
+ 
++#ifdef JSON_GENERATOR
++static void fbuffer_init(FBuffer *fb, unsigned long initial_length, VALUE io, char *stack_buffer, long stack_buffer_size)
++{
++    if (RTEST(io)) {
++        fb->io = io;
++        fb->initial_length = (initial_length > 0) ? initial_length : FBUFFER_IO_BUFFER_SIZE;
++    } else {
++        fbuffer_stack_init(fb, initial_length, stack_buffer, stack_buffer_size);
++    }
++}
++#endif
++
+ static void fbuffer_free(FBuffer *fb)
+ {
+     if (fb->ptr && fb->type == FBUFFER_HEAP_ALLOCATED) {
+@@ -99,45 +111,40 @@
+     fbuffer_clear(fb);
+ }
+ 
+-static void fbuffer_realloc(FBuffer *fb, unsigned long required)
++static void fbuffer_realloc(FBuffer *fb, unsigned long new_capa)
+ {
+-    if (required > fb->capa) {
++    if (new_capa > fb->capa) {
+         if (fb->type == FBUFFER_STACK_ALLOCATED) {
+             const char *old_buffer = fb->ptr;
+-            fb->ptr = ALLOC_N(char, required);
++            fb->ptr = ALLOC_N(char, new_capa);
+             fb->type = FBUFFER_HEAP_ALLOCATED;
+             MEMCPY(fb->ptr, old_buffer, char, fb->len);
+         } else {
+-            REALLOC_N(fb->ptr, char, required);
++            REALLOC_N(fb->ptr, char, new_capa);
+         }
+-        fb->capa = required;
++        fb->capa = new_capa;
+     }
+ }
+ 
+ static void fbuffer_do_inc_capa(FBuffer *fb, unsigned long requested)
+ {
+     if (RB_UNLIKELY(fb->io)) {
+-        if (fb->capa < FBUFFER_IO_BUFFER_SIZE) {
+-            fbuffer_realloc(fb, FBUFFER_IO_BUFFER_SIZE);
+-        } else {
++        if (fb->capa != 0) {
+             fbuffer_flush(fb);
+-        }
+-
+-        if (RB_LIKELY(requested < fb->capa)) {
+-            return;
++            if (RB_LIKELY(requested < fb->capa)) {
++                return;
++            }
+         }
+     }
+ 
+-    unsigned long required;
++    unsigned long new_capa = fb->capa ? fb->capa : fb->initial_length;
++    unsigned long needed_capa = requested + fb->len;
+ 
+-    if (RB_UNLIKELY(!fb->ptr)) {
+-        fb->ptr = ALLOC_N(char, fb->initial_length);
+-        fb->capa = fb->initial_length;
++    while (new_capa < needed_capa) {
++        new_capa *= 2;
+     }
+ 
+-    for (required = fb->capa; requested > required - fb->len; required <<= 1);
+-
+-    fbuffer_realloc(fb, required);
++    fbuffer_realloc(fb, new_capa);
+ }
+ 
+ static inline void fbuffer_inc_capa(FBuffer *fb, unsigned long requested)
+--- a/ext/json/generator/generator.c
++++ b/ext/json/generator/generator.c
+@@ -1080,10 +1080,8 @@
+     GET_STATE(self);
+ 
+     char stack_buffer[FBUFFER_STACK_SIZE];
+-    FBuffer buffer = {
+-        .io = RTEST(io) ? io : Qfalse,
+-    };
+-    fbuffer_stack_init(&buffer, state->buffer_initial_length, stack_buffer, FBUFFER_STACK_SIZE);
++    FBuffer buffer = { 0 };
++    fbuffer_init(&buffer, state->buffer_initial_length, io, stack_buffer, FBUFFER_STACK_SIZE);
+ 
+     struct generate_json_data data = {
+         .buffer = &buffer,
+@@ -1534,10 +1532,8 @@
+     configure_state(&state, opts);
+ 
+     char stack_buffer[FBUFFER_STACK_SIZE];
+-    FBuffer buffer = {
+-        .io = RTEST(io) ? io : Qfalse,
+-    };
+-    fbuffer_stack_init(&buffer, state.buffer_initial_length, stack_buffer, FBUFFER_STACK_SIZE);
++    FBuffer buffer = { 0 };
++    fbuffer_init(&buffer, state.buffer_initial_length, io, stack_buffer, FBUFFER_STACK_SIZE);
+ 
+     struct generate_json_data data = {
+         .buffer = &buffer,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby.git/commitdiff/b0b42d5df9b776d5e57d32a6c0a05899f0cfe84b



More information about the pld-cvs-commit mailing list