Stream: git-wasmtime

Topic: wasmtime / PR #3038 Cranelift fuzzer POC


view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:34):

afonso360 opened PR #3038 from fuzz-gen to main:

Hey!

Here's an initial version of the cranelift fuzzer.

We generate a random cranelift function based on input bytes from the fuzzer. Currently we can generate 7 instructions, but it is already enough to get us into trouble.

There is also a gen_testcase util that grabs fuzzer artifacts and converts them into clif files for easier testing.

In order for the fuzzer to be useful in testing DivByZero traps we need to disable overflow checks:

 RUSTFLAGS="-C overflow-checks=off" cargo fuzz run fuzzgen

Otherwise, the interpreter crashes immediately with overflows (We also need to fix this).

I've based my design a lot on @fitzgen 's blog post about wasm-smith. Its what made me start thinking about building this for cranelift in the first place. Thanks!

CC: @cfallin, @andrewbrown, @fitzgen, @bjorn3 from the earlier fuzzer discussion

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:47):

afonso360 updated PR #3038 from fuzz-gen to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:

use libfuzzer_sys::fuzz_target;

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:



view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:



view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:

This probably needs to be changed.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:

use cranelift:codegen::ir::Function;

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:

cranelift = { path = "../umbrella" }
cranelift-filetests = { path = "../filetests" }
cranelift-interpreter = { path = "../interpreter" }
cranelift-fuzzgen = { path = "../fuzzgen" }

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 16:52):

bjorn3 created PR review comment:

Can you please move the doc comments above the attributes?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 27 2021 at 17:09):

afonso360 updated PR #3038 from fuzz-gen to main.


Last updated: Nov 22 2024 at 17:03 UTC