Repository navigation
Conversation
|
Seems reasonable to me! Should the tool perhaps be developed on a separate branch until it's more fleshed out? Also in terms of the skeleton, there's a |
I'd like to avoid waiting on one gigantic PR for the whole tool so that we can review incremental PRs. But I guess we could make a series of incremental PRs to a longer-lived
That is how we generate a structure from the fuzzer's raw input. This design is based on the custom mutator hooks that |
d97e81d to
8839a9b
Compare
`wasm-mutate` will be a new tool for fuzzing Wasm compilers, runtimes, validators, and other Wasm-consuming programs. `wasm-mutate` will take in an existing Wasm module and then apply a pseudo-random transformation to it, producing a new, mutated Wasm module. This new Wasm module will be fed into the system under test, potentially triggering a bug that users can then diagnose and fix. `wasm-mutate` should additionally support the following features: * `wasm-mutate` should have the ability to restrict mutations to only those that shrink the size of the Wasm module, e.g. removing a function from the Wasm module. When used in this mode, `wasm-mutate` essentially becomes a Wasm test-case reducer. * `wasm-mutate` should have the ability to only apply semantics-preserving changes to the input Wasm module. When used in this mode, the mutated Wasm should compute identical results when given the same inputs as the original Wasm module. * `wasm-mutate` should be deterministic. When given the same input Wasm module and the same seed, it should always produce the same mutated output Wasm module. * `wasm-mutate` should play nice with mutation-based fuzzers like libFuzzer. It should reuse the fuzzer's raw input strings when it makes sense (e.g. when adding an export, use the raw fuzzer input when choosing an export name) so that fuzzer features like dictionary files can be leveraged. `wasm-mutate` should integrate with the `LLVMFuzzerCustomMutator` hook and the `libfuzzer_sys::fuzz_mutator!` macro.
8839a9b to
83c669f
Compare
|
Nah yeah I also agree it'd be good for incremental reviews, but if you're ok I'd prefer to develop on a separate branch and we can merge to main when it's ready to go. For |
alexcrichton
left a comment
There was a problem hiding this comment.
Oh and this looks good to go to me, so feel free to make a branch and such.
|
Okay, I'll push this to the |
Gotcha ! |
…codealliance#322)" (bytecodealliance#329) This reverts commit 126f8e8. We chose not to use this approach to smuggling component type information in core modules. See WebAssembly/component-model#106 (comment) for more details.
wasm-mutatewill be a new tool for fuzzing Wasm compilers, runtimes,validators, and other Wasm-consuming programs.
wasm-mutatewill take in anexisting Wasm module and then apply a pseudo-random transformation to it,
producing a new, mutated Wasm module. This new Wasm module will be fed into the
system under test, potentially triggering a bug that users can then diagnose and
fix.
wasm-mutateshould additionally support the following features:wasm-mutateshould have the ability to restrict mutations to only those thatshrink the size of the Wasm module, e.g. removing a function from the Wasm
module. When used in this mode,
wasm-mutateessentially becomes a Wasmtest-case reducer.
wasm-mutateshould have the ability to only apply semantics-preservingchanges to the input Wasm module. When used in this mode, the mutated Wasm
should compute identical results when given the same inputs as the original
Wasm module.
wasm-mutateshould be deterministic. When given the same input Wasm moduleand the same seed, it should always produce the same mutated output Wasm
module.
wasm-mutateshould play nice with mutation-based fuzzers like libFuzzer. Itshould reuse the fuzzer's raw input strings when it makes sense (e.g. when
adding an export, use the raw fuzzer input when choosing an export name) so
that fuzzer features like dictionary files can be leveraged.
wasm-mutateshould integrate with the
LLVMFuzzerCustomMutatorhook and thelibfuzzer_sys::fuzz_mutator!macro.cc @Jacarte:
You can run the CLI via
cargo run --bin wasm-mutatein the root of this repoYou can run its (pretty much non-existant) tests via
cargo test -p wasm-mutatein the root of the repo.The library is at
crates/wasm-mutate/src/lib.rsand the executable CLI that wraps it is atsrc/bin/wasm-mutate.rs.