qiyuhuating opened PR #14713 from qiyuhuating:fix/vmctx-odd-tag-function-ref-alignment to bytecodealliance:main:
Summary
Fixes #14671.
Defined tags use four-byte slots; an odd count can misalign the following pointer-sized
func_refsand subsequent fields on 64-bit targets. Addalign { ptr }betweentagsandfunc_refsin the shared VMContext layout.Changes
- Correct pointer alignment without unnecessary padding on 32-bit targets.
- Add offset regression tests for 32/64-bit pointers and 0–3 defined tags.
- Assert alignment of
func_refs,startup_func_ref, andruntime_data_bases.Verification
Source diff reviewed. Rust compilation, formatting, and tests are not yet run. Recommended:
cargo test -p wasmtime-environ vmctx_function_references_are_aligned_after_tagsandcargo fmt --all -- --check.
qiyuhuating requested dicej for a review on PR #14713.
qiyuhuating requested wasmtime-core-reviewers for a review on PR #14713.
:cross_mark: alexcrichton closed without merge PR #14713.
alexcrichton commented on PR #14713:
Thanks for the PR but this is a source of UB and thus a security issue for Wasmtime. We'll be publishing an advisory at https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-p79w-pv2r-29qp and we've got PRs prepped to go into
maintoday for this.
qiyuhuating commented on PR #14713:
Thanks for clarifying, @alexcrichton, and for handling the fix and advisory. I should have raised this through the security reporting process first. I'll leave the coordinated fix to you.
Last updated: Oct 31 2026 at 23:03 UTC