[前][次][番号順一覧][スレッド一覧]

ruby-changes:65223

From: nagachika <ko1@a...>
Date: Thu, 11 Feb 2021 12:32:35 +0900 (JST)
Subject: [ruby-changes:65223] 29bc77f780 (ruby_2_7): merge revision(s) 9fb60672d55162a92ab7e97b000a7e277458aab1: [Backport #17313]

https://git.ruby-lang.org/ruby.git/commit/?id=29bc77f780

From 29bc77f780bbefca60724e52129f5229aa373551 Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Thu, 11 Feb 2021 12:31:21 +0900
Subject: merge revision(s) 9fb60672d55162a92ab7e97b000a7e277458aab1: [Backport
 #17313]

	Fix a use-after-free bug reported by ASAN

	If a fiber and thread are collected at the same time, the thread might
	get collected first and the pointer on the fiber will go bad.  I don't
	think we need to check whether or not this is the main fiber in order to
	release its stack
	---
	 cont.c | 4 +---
	 1 file changed, 1 insertion(+), 3 deletions(-)
---
 cont.c    | 4 +---
 version.h | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/cont.c b/cont.c
index a8321ab..0c49d34 100644
--- a/cont.c
+++ b/cont.c
@@ -919,9 +919,7 @@ cont_free(void *ptr) https://github.com/ruby/ruby/blob/trunk/cont.c#L919
     else {
         rb_fiber_t *fiber = (rb_fiber_t*)cont;
         coroutine_destroy(&fiber->context);
-        if (!fiber_is_root_p(fiber)) {
-            fiber_stack_release(fiber);
-        }
+        fiber_stack_release(fiber);
     }
 
     RUBY_FREE_UNLESS_NULL(cont->saved_vm_stack.ptr);
diff --git a/version.h b/version.h
index bf6de0e..9d7c1f8 100644
--- a/version.h
+++ b/version.h
@@ -2,11 +2,11 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L2
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 3
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 148
+#define RUBY_PATCHLEVEL 149
 
 #define RUBY_RELEASE_YEAR 2021
-#define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 30
+#define RUBY_RELEASE_MONTH 2
+#define RUBY_RELEASE_DAY 11
 
 #include "ruby/version.h"
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]