summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-02-11 12:31:21 +0900
committernagachika <nagachika@ruby-lang.org>2021-02-11 12:31:21 +0900
commit29bc77f780bbefca60724e52129f5229aa373551 (patch)
tree80988d0affdb2c5a2945e301edcee02f52ce5f4c
parent7332b3f367ce61089bf571fa1c458fde06a11eab (diff)
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(-)
-rw-r--r--cont.c4
-rw-r--r--version.h6
2 files changed, 4 insertions, 6 deletions
diff --git a/cont.c b/cont.c
index a8321abcca..0c49d34742 100644
--- a/cont.c
+++ b/cont.c
@@ -919,9 +919,7 @@ cont_free(void *ptr)
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 bf6de0eec7..9d7c1f8847 100644
--- a/version.h
+++ b/version.h
@@ -2,11 +2,11 @@
# 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"