wasm2c: allow embedder to configure elimination of dead OOB reads - #2826
Open
shravanrn wants to merge 1 commit into
Open
wasm2c: allow embedder to configure elimination of dead OOB reads#2826shravanrn wants to merge 1 commit into
shravanrn wants to merge 1 commit into
Conversation
Collaborator
Author
|
@sbc100 I have split out the change as requested. As noted above, this is a change I definitely want to land and use soon due to the performance implications. |
shravanrn
force-pushed
the
noforceread
branch
2 times, most recently
from
August 17, 2026 00:10
4bcb340 to
cebcc4e
Compare
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.
This PR also allows the embedder to disable force_reads (this is off by default, since it is non conforming), as it speeds up several sandboxing workloads by a large amount
While the force read preserves Wasm's determinism guarantees, it clearly comes at a large cost. This cost is not worth for embedders that care only about security and not the determinism guarantees. These are both libraries that Firefox currently sandboxes, and thus this is a feature that I definitely want to land and use.
wasm2c would not be the first compiler to add the option for this feature. Currently Wamr and aWsm enable this by default and don't have a way to disable it, while Wasmer enables it by default and has a switch to disable it. I think wasm2c should remain conformant and not go that far, but it can provide an off-by-default option for this.
Additionally, the actual feature is only about 5 lines so is easy enough to maintain.