ruby/tool
NARUSE, Yui ce6863a0cf
merge revision(s) 18573b8d05: [Backport #20178] (#9822)
Avoid reading unused lvars in Primitive.cexpr

	Previously on builds with optimizations disabled, this could result in
	an out of bounds read. When we had all of:
	* built with -O0
	* Leaf builtin
	* Primitive.mandatory_only
	* "no args builtin", called by vm_call_single_noarg_inline_builti
	* The stack is escaped to the heap via binding or a proc

	This is because mk_builtin_loader generated reads for all locals
	regardless of whether they were used and in the case we generated a
	mandatory_only iseq that would include more variables than were actually
	available.

	On optimized builds, the invalid accesses would be optimized away, and
	this also was often unnoticed as the invalid access would just hit
	another part of the stack unless it had been escaped to the heap.

	The fix here is imperfect, as this could have false positives, but since
	Primitive.cexpr! is only available within the cruby codebase itself
	that's probably fine as a proper fix would be much more challenging (the
	only false positives we found were in rjit.rb).

	Fixes [Bug #20178]

	Co-authored-by: Adam Hess <HParker@github.com>
	---
	 bootstraptest/test_method.rb | 9 +++++++++
	 tool/mk_builtin_loader.rb    | 6 ++++++
	 2 files changed, 15 insertions(+)
2024-02-04 04:13:15 +00:00
..
annocheck
bundler Fix Sinatra warning during specs 2023-12-16 10:09:50 +08:00
lib merge revision(s) e12d4c654e: [Backport #20104] 2024-01-30 20:29:02 +09:00
lrama Lrama v0.5.12 2023-12-07 21:07:38 +09:00
m4 Ignore the spcial case of target_cpu 2023-12-15 15:39:14 +09:00
releng
rjit RJIT: Distinguish Pointer with Array 2023-12-22 11:24:04 -08:00
ruby_vm Escape non-ascii characters in prelude C comments 2023-08-24 21:12:51 +09:00
test Follow removed conflict files 2023-12-15 22:37:38 +09:00
test_for_warn_bundled_gems Added simple test script 2023-12-16 16:36:47 +08:00
asm_parse.rb
bisect.sh
build-transcode
checksum.rb
colors
darwin-ar Include --no-llvm-bc option in NM macro only if usable 2023-04-08 12:47:27 +09:00
darwin-cc Ignore warnings about currently unsupported .debug_macinfo 2023-11-07 23:19:51 +09:00
disable_ipv6.sh
downloader.rb downloader.rb: unlink broken symlink before caching to fix ENOENT 2023-07-27 17:09:08 -04:00
enc-case-folding.rb
enc-emoji-citrus-gen.rb
enc-emoji4unicode.rb
enc-unicode.rb Use the hexdigit character class 2023-10-02 00:49:05 +09:00
eval.rb
expand-config.rb
extlibs.rb
fake.rb [Bug #19967] Ignore library before build 2023-10-21 23:47:29 +09:00
fetch-bundled_gems.rb We should not validate development version of bundled gems with fetch timing. 2023-05-09 12:57:12 +09:00
file2lastrev.rb
format-release fix regexp pattern of diff 2023-12-12 11:22:40 +09:00
gen-github-release.rb
gen-mailmap.rb
gen_dummy_probes.rb
gen_ruby_tapset.rb
generic_erb.rb
git-refresh
gperf.sed
id2token.rb
ifchange
insns2vm.rb
install-sh
intern_ids.rb
leaked-globals Ignore symbols even in empty shared library 2023-10-14 18:38:24 +09:00
ln_sr.rb Fix tool/ln_sr.rb passing 2 arguments to String#chomp! 2023-12-13 07:05:21 -08:00
make-snapshot make-snapshot: update RUBY_PATCHLEVEL_STR regexp 2023-11-13 11:28:48 +09:00
make_hgraph.rb
mdoc2man.rb
merger.rb tool/merger.rb: Support commit URLs as revisions 2023-07-23 22:47:09 +09:00
missing-baseruby.bat Add tool/missing-baseruby.bat, used when BASERUBY not available 2023-12-19 21:30:47 -08:00
mk_builtin_loader.rb merge revision(s) 18573b8d05: [Backport #20178] (#9822) 2024-02-04 04:13:15 +00:00
mkconfig.rb s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
mkrunnable.rb
node_name.rb
outdate-bundled-gems.rb
parse.rb
prereq.status
probes_to_wiki.rb
rbinstall.rb Use gemspec that keeps original dependencies 2023-03-27 17:45:43 +09:00
rbs_skip_tests Bundle rbs-3.3.1 (#8921) 2023-11-21 09:21:24 +00:00
rbuninstall.rb
redmine-backporter.rb
release.sh
rmdirs
rubyspec_temp.rb Use shorter path as SPEC_TEMP_DIR 2023-04-21 22:24:55 +09:00
run-gcov.rb
run-lcov.rb
runruby.rb Support RUNRUBY_USE_RR for rr debugger 2023-11-29 17:54:58 -05:00
search-cgvars.rb
strip-rdoc.rb
sync_default_gems.rb Follow removed conflict files 2023-12-15 22:37:38 +09:00
test-annocheck.sh
test-bundled-gems.rb Typofix under lib and test, tool directories 2023-12-25 11:32:42 +09:00
test-coverage.rb
transcode-tblgen.rb
travis_retry.sh
travis_wait.sh
update-bundled_gems.rb Update newer version gems only 2023-11-04 11:29:42 +09:00
update-deps Rename YARP symbols to prism 2023-09-27 13:57:38 -04:00
update-NEWS-gemlist.rb [DOC] "is now bundled" is ambiguous 2023-10-19 16:37:11 -07:00
update-NEWS-refs.rb
vtlh.rb
wasm-clangw