Skip to content

Add corpus support to local DotnetFuzzing runs and fuzz Deflate64 - #121019

Merged
rzikm merged 4 commits into
dotnet:mainfrom
rzikm:fuzzer-corpora
Nov 13, 2025
Merged

rzikm merged 4 commits into
dotnet:mainfrom
rzikm:fuzzer-corpora

Conversation

@rzikm

@rzikm rzikm commented Oct 23, 2025

Copy link
Copy Markdown
Member

This PR introduces corpus support for the DotnetFuzzing project. Currently this works for local runs only (OneFuzz requires creating a special container for corpus, which probably needs to be done manually -- once per fuzzer, this is left for future work).

Currently, some fuzzers (IMO incorrectly) use dictionaries as a replacement for lack of corpus support, which makes fuzzing inefficient. This PR prepares ground for future improvements in this regard.

To validate the concept, this PR converts ZipArchive fuzzing to use corpus instead of a dictionary, and adds code to fuzz Deflate64 (for which we have managed implementation internal to reading ZipArchives).

@rzikm
rzikm marked this pull request as ready for review October 23, 2025 13:57
Copilot AI review requested due to automatic review settings October 23, 2025 13:57
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 23, 2025
@rzikm

rzikm commented Oct 23, 2025

Copy link
Copy Markdown
Member Author

cc @MihaZupan

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds corpus support to the DotnetFuzzing project for local runs, allowing fuzzers to use seed corpora instead of relying on dictionaries. The change improves fuzzing efficiency by providing proper initial test cases. The ZipArchiveFuzzer is updated to use a corpus, and a new Deflate64Fuzzer is introduced to test the managed Deflate64 decompression implementation.

  • Adds corpus infrastructure to the fuzzing framework with validation and deployment logic
  • Converts ZipArchiveFuzzer to use corpus instead of dictionary for better fuzzing effectiveness
  • Introduces Deflate64Fuzzer to test internal Deflate64 decompression used in ZipArchive reading

Reviewed Changes

Copilot reviewed 6 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/libraries/Fuzzing/DotnetFuzzing/Program.cs Adds corpus directory handling, validation, and deployment logic for both OneFuzz and local runs
src/libraries/Fuzzing/DotnetFuzzing/IFuzzer.cs Extends IFuzzer interface with optional Corpus property
src/libraries/Fuzzing/DotnetFuzzing/Fuzzers/ZipArchiveFuzzer.cs Adds corpus property to use seed files instead of dictionary
src/libraries/Fuzzing/DotnetFuzzing/Fuzzers/Deflate64Fuzzer.cs New fuzzer for testing Deflate64 decompression with reflection-based stream creation
src/libraries/Fuzzing/DotnetFuzzing/DotnetFuzzing.csproj Simplifies fuzzer file inclusion using wildcard and adds corpus files to build output
eng/pipelines/libraries/fuzzing/deploy-to-onefuzz.yml Adds OneFuzz deployment task for new Deflate64Fuzzer

@rzikm rzikm added area-Meta and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 23, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

@rzikm
rzikm requested a review from MihaZupan October 23, 2025 14:01
@MihaZupan MihaZupan added this to the 11.0.0 milestone Oct 23, 2025
@rzikm

rzikm commented Nov 13, 2025

Copy link
Copy Markdown
Member Author

/ba-g Test failures are unrelated

@premun

premun commented Nov 24, 2025

Copy link
Copy Markdown
Member

@rzikm

rzikm commented Nov 24, 2025

Copy link
Copy Markdown
Member Author

We will move the fuzzing corpora to runtime-assets: dotnet/runtime-assets#618 (review)

rzikm added a commit that referenced this pull request Nov 26, 2025
This PR addresses VMR build failres where a task checks for presence of
binary files in the repo. See
#121019 (comment)
for more context.
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants