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

Implement EngineLimits for Wasmi #985

Merged
merged 34 commits into from
Apr 20, 2024
Merged

Implement EngineLimits for Wasmi #985

merged 34 commits into from
Apr 20, 2024

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Apr 18, 2024

Closes #980.

This initial implementation does not allow full customization of the EngineLimits type and only offers two modes:

  • EngineLimits::default: disables all limits (as it is now)
  • EngineLimits::strict: enables strict limits to prevent malicious inputs from taking major effect

In later revisions we might allow users to partially or fully customize the EngineLimits but for now we keep it as a black box.

Enabled via:

let mut config = wasmi::Config::default();
config.engine_limits(wasmi::EngineLimits::strict());

@athei I hope this implementation is black boxy enough for your likes.

Copy link

codecov bot commented Apr 18, 2024

Codecov Report

Attention: Patch coverage is 76.84729% with 47 lines in your changes are missing coverage. Please review.

Project coverage is 81.84%. Comparing base (48d5fb2) to head (2079f1c).

Files Patch % Lines
crates/wasmi/src/engine/limits/engine.rs 0.00% 30 Missing ⚠️
crates/wasmi/src/module/parser.rs 73.58% 14 Missing ⚠️
crates/wasmi/src/engine/config.rs 66.66% 2 Missing ⚠️
crates/wasmi/src/error.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #985      +/-   ##
==========================================
- Coverage   81.87%   81.84%   -0.04%     
==========================================
  Files         260      262       +2     
  Lines       23904    24102     +198     
==========================================
+ Hits        19572    19726     +154     
- Misses       4332     4376      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Robbepop Robbepop merged commit f3f5863 into master Apr 20, 2024
15 of 17 checks passed
@Robbepop Robbepop deleted the rf-engine-limits branch April 20, 2024 17:28
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.

Add customizable wasmi::Engine limits
1 participant