Sitelet https://github.com/bytecodealliance/wasmtime/pull/14540
Skip to content

[stack-switching] Bounds-check continuation payload writes - #14540

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
dhil:stack-switching-bounds
Oct 5, 2026
Merged

alexcrichton merged 2 commits into
bytecodealliance:mainfrom
dhil:stack-switching-bounds

Conversation

@dhil

@dhil dhil commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

This patch adds a defensive check in occupy_next_slot, ensuring that a continuation's data buffer has sufficient capacity. I believe a well-typed Wasm program should never be able to fail this check, thus failing it ought to indicate some external tampering with continuation objects.

Resolves #13028. Note the root cause in #13028 was fixed by PR#11717. This PR resolves the issue in the sense that it adds the defensive suggestion outlined in the issue.

This patch adds a defensive check in `occupy_next_slot`, ensuring that
a continuation's data buffer has sufficient capacity. I believe a
well-typed Wasm program should never be able to fail this check, thus
failing it ought to indicate some external tampering with continuation
objects.
@dhil
dhil requested review from a team as code owners October 5, 2026 15:04
@dhil
dhil requested review from alexcrichton and removed request for a team October 5, 2026 15:04
Comment thread tests/all/stack_switching.rs Outdated
@alexcrichton
alexcrichton added this pull request to the merge queue Oct 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 5, 2026
@alexcrichton
alexcrichton added this pull request to the merge queue Oct 5, 2026
Merged via the queue into bytecodealliance:main with commit 4084ffe Oct 5, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack-switching crash with traps and missing bounds checks

2 participants