Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of table.init with out-of-bounds element segment #4014

Open
Q1IQ opened this issue Jan 9, 2025 · 1 comment
Open

Incorrect handling of table.init with out-of-bounds element segment #4014

Q1IQ opened this issue Jan 9, 2025 · 1 comment

Comments

@Q1IQ
Copy link

Q1IQ commented Jan 9, 2025

Subject of the issue

iwasm fails to correctly handle table.init when attempting out-of-bounds table access, resulting in unexpected behavior or a failure to throw the expected exception.

Test case

program.wasm.txt

Your environment

  • OS: Ubuntu 20.04
  • CPU: amd64
  • WAMR version: iwasm 2.2.0
  • Commands:
iwasm --interp -f main ./program.wasm
iwasm --fast-jit -f main ./program.wasm
iwasm --llvm-jit -f main ./program.wasm
iwasm --multi-tier-jit -f main./program.wasm

Expected behavior

The WebAssembly runtime should detect the out-of-bounds table access during table.init and report the error. A valid error message should look like:

Out of bounds table access
@TianlongLiang
Copy link
Collaborator

This is an issue caused by a lack of checking table segment mode(it has to be passive to use by table init), I'm working on it to fix it.

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

No branches or pull requests

2 participants