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

Fix issue 800 - check index before accessing imports.globals #809

Merged
merged 3 commits into from
Sep 25, 2019

Conversation

pventuzelo
Copy link
Contributor

@pventuzelo pventuzelo commented Sep 18, 2019

Description

Fix issue #800

  • Check if import_global_index is valid i.e inside imports.globals range.
  • Related functions:
    • validate_memories
    • validate_tables
    • finalize_memories
    • finalize_tables

After the fix

$ ./target/release/wasmer run index_oob_LocalBacking_validate_memories_152.wasm
execute_wasm: "Can\'t instantiate module: LinkError([Generic { message: \"incorrect global index for initializer\" }])"
--------------------------------------------------------------------------------------------------------
$ ./target/release/wasmer run index_oob_LocalBacking_validate_tables_276.wasm 
execute_wasm: "Can\'t instantiate module: LinkError([Generic { message: \"incorrect global index for initializer\" }])"

Review

  • Create a short description of the the change in the CHANGELOG.md file

@syrusakbary
Copy link
Member

@pventuzelo can you add the changes of this PR into the CHANGELOG.md? Once is done we should be ready to merge!

@pventuzelo pventuzelo force-pushed the ventuzelo/fix-800-index-oob-backing branch from 4a47ea8 to 08665f7 Compare September 25, 2019 07:29
@pventuzelo
Copy link
Contributor Author

@syrusakbary Done ;)

@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Sep 25, 2019
809: Fix issue 800 - check index before accessing imports.globals r=syrusakbary a=pventuzelo

# Description

Fix issue #800 

* Check if `import_global_index` is valid i.e inside imports.globals range. 
* Related functions: 
  * validate_memories
  * validate_tables
  * finalize_memories
  * finalize_tables

# After the fix

``` sh
$ ./target/release/wasmer run index_oob_LocalBacking_validate_memories_152.wasm
execute_wasm: "Can\'t instantiate module: LinkError([Generic { message: \"incorrect global index for initializer\" }])"
--------------------------------------------------------------------------------------------------------
$ ./target/release/wasmer run index_oob_LocalBacking_validate_tables_276.wasm 
execute_wasm: "Can\'t instantiate module: LinkError([Generic { message: \"incorrect global index for initializer\" }])"
```

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Sep 25, 2019

Build succeeded

  • wasmerio.wasmer

@bors bors bot merged commit b45a228 into wasmerio:master Sep 25, 2019
@pventuzelo pventuzelo deleted the ventuzelo/fix-800-index-oob-backing branch December 11, 2019 12:02
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