diff --git a/.clusterfuzzlite/build.sh b/.clusterfuzzlite/build.sh index 8f7cb8a1..14342132 100755 --- a/.clusterfuzzlite/build.sh +++ b/.clusterfuzzlite/build.sh @@ -6,7 +6,10 @@ # `fuzz/` and stage each binary into $OUT. Run by `compile` inside the # base-builder-rust image (see .clusterfuzzlite/Dockerfile). cd "$SRC/my-lang" -cargo +nightly fuzz build -O +# Build for the sanitizer OSS-Fuzz requests (defaults to address). NOTE: only +# `address` is configured — Rust/cargo-fuzz cannot emit a valid UBSan binary +# (it links ASan regardless), which `bad_build_check` rejects; see project.yaml. +cargo +nightly fuzz build -O --sanitizer "${SANITIZER:-address}" release="$SRC/my-lang/fuzz/target/x86_64-unknown-linux-gnu/release" for target in fuzz/fuzz_targets/*.rs; do diff --git a/.clusterfuzzlite/project.yaml b/.clusterfuzzlite/project.yaml index 565a66e0..78f17ce6 100644 --- a/.clusterfuzzlite/project.yaml +++ b/.clusterfuzzlite/project.yaml @@ -1,6 +1,9 @@ homepage: "https://github.com/hyperpolymath/my-lang" language: rust main_repo: "https://github.com/hyperpolymath/my-lang" +# Only ASan: Rust/cargo-fuzz does not produce a valid UndefinedBehaviorSanitizer +# build (it links ASan regardless), which OSS-Fuzz's `bad_build_check` rejects +# ("UBSan build ... seems to be compiled with ASan"). ASan is the supported, +# meaningful sanitizer for Rust fuzzing here. sanitizers: - address - - undefined diff --git a/.github/workflows/cflite_batch.yml b/.github/workflows/cflite_batch.yml index 9cd88072..f902698f 100644 --- a/.github/workflows/cflite_batch.yml +++ b/.github/workflows/cflite_batch.yml @@ -11,7 +11,9 @@ jobs: strategy: fail-fast: false matrix: - sanitizer: [address, undefined] + # ASan only: Rust/cargo-fuzz can't emit a valid UBSan binary (links ASan + # regardless), so `undefined` failed bad_build_check. See project.yaml. + sanitizer: [address] steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1 diff --git a/.github/workflows/cflite_pr.yml b/.github/workflows/cflite_pr.yml index f6f4f607..e84d5b0a 100644 --- a/.github/workflows/cflite_pr.yml +++ b/.github/workflows/cflite_pr.yml @@ -14,7 +14,9 @@ jobs: strategy: fail-fast: false matrix: - sanitizer: [address, undefined] + # ASan only: Rust/cargo-fuzz can't emit a valid UBSan binary (links ASan + # regardless), so `undefined` failed bad_build_check. See project.yaml. + sanitizer: [address] steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1