diff options
author | nagachika <nagachika@ruby-lang.org> | 2021-02-11 12:31:21 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-02-11 12:31:21 +0900 |
commit | 29bc77f780bbefca60724e52129f5229aa373551 (patch) | |
tree | 80988d0affdb2c5a2945e301edcee02f52ce5f4c | |
parent | 7332b3f367ce61089bf571fa1c458fde06a11eab (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.c | 4 | ||||
-rw-r--r-- | version.h | 6 |
2 files changed, 4 insertions, 6 deletions
@@ -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); @@ -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" |