Skip to content

[interp] Add bounds checks in func/table/memory/global/tag handlers#2794

Open
lexi-nadia wants to merge 2 commits into
WebAssembly:mainfrom
lexi-nadia:fuzz1
Open

[interp] Add bounds checks in func/table/memory/global/tag handlers#2794
lexi-nadia wants to merge 2 commits into
WebAssembly:mainfrom
lexi-nadia:fuzz1

Conversation

@lexi-nadia

Copy link
Copy Markdown
Collaborator

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!

This fixes a case of undefined error caught by fuzzing, and defends
against some other similar possible errors.
@lexi-nadia lexi-nadia requested a review from sbc100 July 9, 2026 21:22
validator_.OnFunction(GetLocation(), Var(sig_index, GetLocation())));
if (sig_index >= module_.func_types.size()) {
return Result::Error;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

@sbc100 sbc100 changed the title Add bounds checks in func/table/memory/global/tag handlers [interp] Add bounds checks in func/table/memory/global/tag handlers Jul 9, 2026
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.

2 participants