Add knobs to limit memories/tables in a Store
Fuzzing has turned up that module linking can create large amounts of tables and memories in addition to instances. For example if N instances are allowed and M tables are allowed per-instance, then currently wasmtime allows MxN tables (which is quite a lot). This is causing some wasm-smith-generated modules to exceed resource limits while fuzzing! This commits adds corresponding `max_tables` and `max_memories` functions to sit alongside the `max_instances` configuration. Additionally fuzzing now by default configures all of these to a somewhat low value to avoid too much resource usage while fuzzing.
This commit is contained in:
@@ -39,6 +39,9 @@ pub fn fuzz_default_config(strategy: wasmtime::Strategy) -> anyhow::Result<wasmt
|
||||
.wasm_bulk_memory(true)
|
||||
.wasm_reference_types(true)
|
||||
.wasm_module_linking(true)
|
||||
.max_instances(100)
|
||||
.max_tables(100)
|
||||
.max_memories(100)
|
||||
.strategy(strategy)?;
|
||||
Ok(config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user