Files
rustfs/fuzz
RustFS d82bf5b1f5 fix(ecstore,scanner,heal): fix rolling, grey-fault, and scanner bugs (#9804)
* fix(ecstore,rustfs): fix rolling restarts, health probe, and request_id

- Unpin STREAM_AUTH_PINNED_ENDPOINTS on authenticated peer boot_epoch
  rotation (probed via signed Ping on legacy-downgraded streams) while
  remaining fail-closed for unauthenticated downgrades under unchanged
  epochs, fixing 1.0.8 -> 1.0.7 rollback stream-auth failures.
- Probe peer boot_epoch and re-sign replay scope headers on transient
  internode gRPC Unauthenticated errors during same-version restarts.
- Propagate online_drives_strict onReadQuorum retry hints and treat
  transient transport disconnects during quorum reads as retriable shard
  unavailable errors instead of immediate 503 SlowDown.
- Evaluate live erasure set read/write quorums across local and remote
  drives in /minio/health/cluster and /minio/health/cluster/read so a
  2/4-node outage returns HTTP 503 instead of a false-healthy 200.
- Propagate S3 x-amz-request-id end-to-end across internode gRPC and
  HTTP storage RPC boundaries for cross-node observability correlation.

Refs: https://github.com/rustfs/backlog/issues/3390

* fix(connect,release): raise symbol caps, compact 1GiB set, sync 1.0.8

- Raise GNU symbol-catalog budgets (aarch64-gnu 48 MiB, x86_64-gnu
  56 MiB) in crates/connect-symbol-catalog to accommodate expanded
  workspace symbol tables.
- Switch low-RAM (<= 2 GiB cgroup/host) CPU profile symbolizer fallback
  to a compact Vec<(u64, u64, Box<str>)> sorted address table so 1 GiB
  hosts never OOM during CPU profile symbolization.
- Synchronize workspace Cargo.toml, Cargo.lock, flake.nix, rustfs.spec,
  and helm/rustfs/Chart.yaml versions to 1.0.8.

Refs: https://github.com/rustfs/backlog/issues/3390

* fix(filemeta,scanner,heal): stabilize xl.meta, MRF fairness, telemetry

- Sort HashMap entries deterministically before MessagePack encoding in
  FileMeta::encode_to so healed and re-encoded xl.meta shards produce
  identical byte layouts and HighwayHash/CRC checksums across nodes.
- Classify confirmed object absence in MRF heal execution as terminal
  instead of looping recreate_failed retries, and enforce anti-starvation
  fairness for Scanner and ReadRepair lanes under MRF High bursts.
- Expose executed heal counters by source (MRF, Scanner, ReadRepair) in
  MRF status endpoints and export dirty_pending_buckets / scanner cycle
  telemetry in scanner activity snapshots.

Refs: https://github.com/rustfs/backlog/issues/3390

* fix(ecstore): bound 3x4 SIGSTOP stalls with hedging and host fast-fail

- Hedge multi-pending shard reads and read_xl_meta quorum fetches across
  remaining drives instead of stalling behind a single SIGSTOP'd node,
  and bound post-quorum write/delete straggler grace windows.
- Record peer straggler timeouts into host fast-fail windows and apply
  host fast-fail on read retries (including IgnoreFailure attempt 0) so
  subsequent operations bypass hung peers immediately.
- Allow .rustfs.sys metadata read-repair staging under a shared lock so
  a hung peer cannot hold an exclusive write lock for 10s across bucket
  validation paths.
- Switch SetDisks::stat_bucket_with_quorum from join_all to
  FuturesUnordered early-return on presence quorum or strict-majority
  absence so bucket existence revalidation after TTL expiry never blocks
  on a SIGSTOP'd peer.

Refs: https://github.com/rustfs/backlog/issues/3390

* test(ecstore): wire real-ECStore multipart DST cutpoints and SimDisk

- Wire opt-in DST crash cutpoints (MultipartBeforeQuorumRename,
  MultipartMidQuorumRename, MultipartAfterCommitBeforeCleanup) directly
  into SetDisks::complete_multipart_upload_inner and add transactional
  part staging/commit support in DstSimDisk.
- Add real-ECStore deterministic crash-recovery tests verifying
  all-or-nothing multipart visibility and convergent post-crash cleanup.

Refs: https://github.com/rustfs/backlog/issues/3390

* fix(ecstore,fuzz): fix test clippy lint and sync fuzz/Cargo.lock

- Replace index range loop over errs in 3x4 SIGSTOP metadata read test
  with errs.iter().enumerate().take(4) to satisfy clippy --all-targets.
- Sync workspace crate versions to 1.0.8 in fuzz/Cargo.lock so --locked
  fuzz harness checks succeed.
2026-11-30 20:36:16 +08:00
..

RustFS Fuzz Harness

This directory contains the standalone cargo-fuzz harness for RustFS.

It is intentionally isolated from the main workspace so that:

  • root cargo fmt --all
  • root cargo nextest
  • root make pre-commit

continue to behave exactly as they do today.

Prerequisites

Install cargo-fuzz and a nightly toolchain locally:

cargo install cargo-fuzz
rustup toolchain install nightly

Layout

fuzz/
  Cargo.toml
  fuzz_targets/
  corpus/
  artifacts/

Crash reproducers are written under fuzz/artifacts/<target>/.

Targets

  • bucket_validation
    • Exercises RustFS bucket-name and bucket/object argument validation.
  • archive_extract
    • Exercises archive entry path normalization, prefix application, and bucket-namespace containment checks.
  • path_containment
    • Exercises object-path acceptance and containment invariants using public path helpers.
  • local_metadata
    • Exercises rustfs-filemeta metadata decoding and rustfs-utils block decompression.
  • policy_ingress
    • Exercises RustFS-owned bucket policy and policy-doc JSON ingress behavior, including strict-vs-tolerant unknown-field expectations.
  • sigv4_request
    • Exercises public SigV4 request canonicalization and signing APIs (try_sign_v4, try_pre_sign_v4) using bounded Arbitrary requests and raw corpus fixtures with fixed test credentials and timestamp. No-panic client signing is paired with separate server-side presigned header rejection tests and rejection-branch mutation verification.
  • notify_xml
    • Exercises NotificationConfiguration::from_reader and NotificationConfiguration::validate on raw XML bytes and bounded Arbitrary XML variants, asserting deterministic rejection of duplicate queues, invalid filters, and unsupported topic/lambda configurations.

Usage

Run a single target:

cd fuzz
cargo +nightly fuzz run path_containment

Use the unified runner script from the repository root:

# Build + run all smoke targets (60s each)
./scripts/fuzz/run.sh

# Build only (no fuzz run)
BUILD_ONLY=1 ./scripts/fuzz/run.sh

# Build + run a single target
FUZZ_TARGET=path_containment ./scripts/fuzz/run.sh

# Nightly-style: 300s per target
MAX_TOTAL_TIME=300 ./scripts/fuzz/run.sh

# Replay a recorded libFuzzer seed
FUZZ_TARGET=path_containment FUZZ_SEED=123456789 ./scripts/fuzz/run.sh

# Skip build (use pre-built harness)
SKIP_BUILD=1 FUZZ_TARGET=local_metadata ./scripts/fuzz/run.sh

Each run writes fuzz/artifacts/<target>/run-manifest.txt and fuzz/artifacts/<target>/run-summary.json with the target, toolchain, libFuzzer seed, corpus digest, time budget, elapsed runtime (excluding build time), exit code, crash reproducer digest (if any), Git revision and dirty state, and runner mode. CI uploads those artifacts with the corpus and any crash input so the exact run can be replayed.

Critical Rejection-Branch Mutation Verification

Fixed critical rejection-branch mutations are registered in .config/security-rejection-mutants.toml and verified in isolated temporary workspaces via:

python3 scripts/security/check_rejection_mutants.py --self-test
python3 scripts/security/check_rejection_mutants.py --cases .config/security-rejection-mutants.toml

Each mutation runs baseline green first and requires an explicit JUnit assertion failure on the mutated code; compile errors, zero matching tests, timeouts, and harness errors are rejected as invalid verification.

CI Workflow

The GitHub Actions workflow (.github/workflows/fuzz.yml) exposes workflow_call (invoked by ci.yml job security-input-gate) alongside schedule and workflow_dispatch, using a build/run separation pattern:

  1. select-targets uses scripts/fuzz/select_targets.py to select checks from changed paths. Documentation-only and unrelated PRs record N/A. Unknown diffs and merge groups select every target. A PR that changes the selector or target manifest runs the full matrix and rejection checks without executing the changed selector.
  2. fuzz-build — compiles the selected fuzz targets once under a cache key isolated by toolchain, target, lockfile, and harness digest, then uploads prebuilt binaries.
  3. pr-fuzz-smoke — matrix job running each selected target in parallel (60s execution budget per target) plus rejection-mutants verifying the fixed rejection-branch mutations.
  4. nightly-fuzz-corpus — matrix job running all 7 targets in parallel (300s each) on the daily schedule with failure alerting.
  5. security-input-gate-verdict — fail-closed summary gate over all selected workflow_call sub-jobs.

Note: PR smoke and fixed rejection-branch mutations do not substitute for full-application sanitizers, long-running stress tests, or RSS/fd exhaustion gates.

Seed Corpus

Initial seed directories live under fuzz/corpus/.

  • Keep small, representative, and target-specific inputs here.
  • Prefer checked-in fixtures for stable formats like xl.meta.
  • Use cargo fuzz cmin / cargo fuzz tmin to shrink corpora and crashes before committing them.

The helper scripts also invoke cargo +nightly fuzz ... explicitly so local execution does not depend on the default toolchain.