[interp] Add bounds checks in func/table/memory/global/tag handlers#2794
Open
lexi-nadia wants to merge 2 commits into
Open
[interp] Add bounds checks in func/table/memory/global/tag handlers#2794lexi-nadia wants to merge 2 commits into
lexi-nadia wants to merge 2 commits into
Conversation
This fixes a case of undefined error caught by fuzzing, and defends against some other similar possible errors.
sbc100
reviewed
Jul 9, 2026
| validator_.OnFunction(GetLocation(), Var(sig_index, GetLocation()))); | ||
| if (sig_index >= module_.func_types.size()) { | ||
| return Result::Error; | ||
| } |
Member
There was a problem hiding this comment.
I'm curious.. does hitting this (and the other errors here) require disabling the validator? If so I think we should instead remove the ability for the fuzzers to skip validation. I think its reasonable to more of the code in wabt to assume valid inputs only (and use the validator and single point of protection against such).
In I'm right then these could maybe be assertions instead?
If I'm wrong then this change lgtm :)
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 fixes a case of undefined behavior caught by fuzzing, and defends against other similar possible errors.
I don't know how to convert a fuzz test case into regression tests, but I'm happy to add it if someone can point me at an example!