fix(tailcall): Fixes heap buffer overflow in fast interpreter (#4916)#4917
Merged
lum1n0us merged 1 commit intobytecodealliance:mainfrom Apr 17, 2026
Merged
Conversation
…dealliance#4916) Signed-off-by: Stephen Berard <stephen.berard@outlook.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the heap buffer overflow described in #4916 by adding a missing operand-stack bounds check to the fast-interp return_call (tail call) path, and adds a regression test case + CI build target to exercise tail calls in fast-interp.
Changes:
- Add operand stack overflow check in
call_func_from_return_callbefore copying staged tail-call parameters. - Add a regression test module (
tail_call_stack_overflow.wat/.wasm) reproducing the const-pool-size mismatch scenario. - Extend BA regression harness configuration and build script with a tail-call-enabled fast-interp runtime.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
core/iwasm/interpreter/wasm_interp_fast.c |
Adds missing bounds check in fast-interp tail-call parameter staging to prevent out-of-bounds writes. |
tests/regression/ba-issues/running_config.json |
Registers new regression case for issue #4916 using a tail-call-enabled runtime. |
tests/regression/ba-issues/issues/issue-4916/tail_call_stack_overflow.wat |
Adds readable source test that inflates callee const pool and tail-calls from a tiny caller. |
tests/regression/ba-issues/issues/issue-4916/tail_call_stack_overflow.wasm |
Adds compiled wasm artifact used by the regression harness. |
tests/regression/ba-issues/build_wamr.sh |
Builds an additional iwasm variant with fast-interp + tail-call enabled (WASI disabled). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lum1n0us
approved these changes
Apr 17, 2026
kylo5aby
pushed a commit
to kylo5aby/wasm-micro-runtime
that referenced
this pull request
Apr 17, 2026
…dealliance#4916) (bytecodealliance#4917) Signed-off-by: Stephen Berard <stephen.berard@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4916 and adds case to regression tests.