fitzgen opened PR #15321 from fitzgen:main-backport-ee2bd4fea3 to bytecodealliance:main:
GC array accesses previously would compute a pointer to the last byte of the object being addresses, then subtract backwards from there. With spectre mitigations turned on, however, this means that a faulting access would underflow from 0 to the high end of the address space. While this is guaranteed to fault still it's an unrecognized address in Wasmtime's defense-in-depth "is this a faultable address check". This means that when this defense in-depth-check fired it would erroneously consider the faulting access invalid and abort the process instead of handling the trap as usual.
The fix here is to refactor methods a bit further to factor in this "calculate last byte, bounds check, then go backwards for the pointer" check. Now out-of-bounds accesses load from null, like all other out of bounds accesses.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen removed the review request for wasmtime-compiler-reviewers from PR #15321.
fitzgen requested cfallin for a review on PR #15321.
fitzgen requested wasmtime-core-reviewers for a review on PR #15321.
fitzgen requested wasmtime-compiler-reviewers for a review on PR #15321.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton has enabled auto merge for PR #15321.
alexcrichton added PR #15321 Adjust out-of-bounds array loads to the merge queue.
:check: alexcrichton merged PR #15321.
alexcrichton removed PR #15321 Adjust out-of-bounds array loads from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC