Smoke-test the libFuzzer harness on pull requests#4981
Open
matthargett wants to merge 1 commit into
Open
Conversation
The libFuzzer harness in tests/fuzz/wasm-mutator-fuzz already runs continuously on OSS-Fuzz, but nothing in-tree builds or exercises it on a pull request, so a change that breaks the harness build or reintroduces a fixed loader/validator crash is only caught out-of-band, hours to days later via an OSS-Fuzz report. Add a pull_request workflow that builds the same fast-interp and classic-interp targets OSS-Fuzz builds (matching LLVM 18.1.8 and wasm-tools 1.243.0), replays the committed tests/malformed/fuzz regression corpus, and runs a short bounded fuzz, failing on any crash. It needs no secrets and no write permissions, so it behaves identically for pull requests opened within a repository and from forks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a
pull_request-triggered smoke test for the existing libFuzzer harness intests/fuzz/wasm-mutator-fuzz/.The full harness already runs continuously on OSS-Fuzz (
google/oss-fuzz/projects/wamr), but nothing in-tree builds or exercises it on a pull request. So a change that breaks the harness build, or reintroduces a previously fixed loader/validator crash, is only caught out-of-band — an OSS-Fuzz report hours to days after merge. This moves that class of memory-safety regression to a check before review.How
For each of
fast-interp(default) andclassic-interp, the job:smith_wasm.sh.wasm_mutator_fuzztarget (ASan + UBSan + libFuzzer, from the harness's ownsanitizer_flags.cmake).tests/malformed/fuzz/*.wasmregression corpus (deterministic), then runs a short seeded bounded fuzz. Any crash / sanitizer error fails the job.Fork / upstream safety
The job needs no secrets and no write permissions (
permissions: contents: read); it builds and runs only, so it behaves identically for pull requests opened within a repository and from forks.Notes
llvm-jit/aot-compilertargets OSS-Fuzz also builds could be added.paths:limits the job to code / build / fuzz changes. If this is later made a required check, drop the filter or pair it with an always-pass companion job to avoid the required-check-plus-path-filter deadlock..debURL, so the install survives ncurses point-release bumps. The same hard-coded-URL pattern in.github/scripts/codeql_buildscript.shis currently broken; fixed separately in Fix the currently-failing CodeQL workflow and run it on pull requests #4980.Verification
Verified end-to-end on a pull request in a fork: both matrix legs build and run green in ~3.5 min each.