To improve our security, Naga needs a function that can create a Module that passes validation, driven by an arbitrary data stream, like that provided by cargo fuzz. This should be something like WebAssembly's wasm-smith:
Features
Always valid: All generated Wasm modules pass validation. wasm-smith
gets past your wasm parser and validator, exercising the guts of your Wasm
compiler, runtime, or tool.
Supports the full WebAssembly language: Doesn't have blind spots or
unimplemented instructions.
Deterministic: Given the same input seed, always generates the same output
Wasm module, so you can always reproduce test failures.
Plays nice with mutation-based fuzzers: Small changes to the input tend to
produce small changes to the output Wasm module. Larger inputs tend to
generate larger Wasm modules.
To improve our security, Naga needs a function that can create a
Module
that passes validation, driven by an arbitrary data stream, like that provided bycargo fuzz
. This should be something like WebAssembly's wasm-smith: