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(kernel): length function should return 0 for invalid offsets #635

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Dec 15, 2023

Fixes #634

  • Updates extism_length to walks the allocation list to determine valid offsets instead of assuming the provided offset is valid

Automated PR to update `runtime/src/extism-runtime.wasm` in PR #635

Co-authored-by: zshipko <zshipko@users.noreply.github.com>
Copy link
Contributor

@G4Vi G4Vi left a comment

Choose a reason for hiding this comment

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

Tested it out and it works great! Eventually, it may be worth exposing a block so iterating across the blocks isn't required to get the length, but I think this is a good idea for extism_length given the flexibility of an ExtismPointer.

@zshipko zshipko merged commit fd95729 into main Dec 15, 2023
6 checks passed
@zshipko zshipko deleted the fix-kernel-length branch December 15, 2023 00:55
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.

extism_length returns garbage values when an ExtismPointer is not aligned with an alloc
2 participants