-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Acceptance for wasmtime project and Rust fuzz targets #3285
Acceptance for wasmtime project and Rust fuzz targets #3285
Conversation
Hey @jfoote, TravisBuddy Request Identifier: c06579a0-3d82-11ea-bf94-57f545f30904 |
We approve. Shameless plug for my own work fuzzing C binaries in the WASM runtime (SQLite demo, slides) |
🎉
The way that
Would adding support for
Very cool! |
Great, thanks @jonathanmetzman!
This is really cool.
IIUC if we go the |
Adding Then the oss-fuzz build environment would control what libfuzzer was used with Not clear to me whether this is an improvement over providing a path to a |
I think I agree after learning more that the status quo would be better for rust than supporting LIB_FUZZING_ENGINE/-fsanitize=fuzzer. For context, I don't think the perf issue is critical (we did nothing to stop it until this spring and OSS-Fuzz was useful before then). I'm almost more concerned that it is ugly for rust to official depend on something with DEPRECATED in the name. Maybe we need to change it? |
I feel like we don't have much of a trouble supporting It also might be handy for some experiments, as updating / patching / reverting libFuzzer sources only is easier than doing LLVM roll ourselves (right now we depend on Chromium for that). |
Hello,
Bytecode Alliance projects are developed in the open, largely in Rust. As part of designing continuous fuzzing for Bytecode Alliance projects we are evaluating how we might integrate Rust fuzz targets with oss-fuzz. (some background: Bytecode Alliance discussion issue, oss-fuzz PR for an unrelated Rust fuzz target from last year).
This PR is for project acceptance for Rust fuzzing targets for wasmtime. @fitzgen and I did some analysis and made a few modifications to Rust's libfuzzer wrapper and cargo-fuzz to towards an integration with oss-fuzz. It works, but it isn't perfect yet. Here are some highlights:
libFuzzingEngine
)-fsanitizer=fuzzer
is not supported directly, we use the default flags used by cargo fuzz and link withLIB_FUZZING_ENGINE_DEPRECATED
libFuzzingEngine.a
produces a linker error. I suspect an incompatibility in the instrumenting/linking used inlibFuzzingEngine.a
and what rustc/libfuzzer are using, but I did not dive in.fsanitize*
flags are not supported, so they must be stripped. As a workaround I hard-coded the CFLAGS/CXXFLAGS frominfra/base-images/base-clang
into this project'sbuild.sh
since this seems to be what is used in the oss-fuzz build container today once you remove the sanitizer flags, but this is not a good long-term solution.We have a draft oss-fuzz wasmtime integration staged here.
We wanted to get your thoughts on integrating with Rust projects: Do you feel this is a viable path forward for long-term integration with Rust targets? If so, what else do you think would need to be done before we can start using oss-fuzz for Bytecode Alliance projects in the short-term?
Thanks,
Jon