Skip to content

Add Rust reader fuzz targets - #1908

Open
manas765 wants to merge 1 commit into
foxglove:mainfrom
manas765:add-rust-reader-fuzz-targets
Open

manas765 wants to merge 1 commit into
foxglove:mainfrom
manas765:add-rust-reader-fuzz-targets

Conversation

@manas765

@manas765 manas765 commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

  • Add cargo-fuzz targets for MessageStream, Summary::read, and LinearReader.
  • Bound input sizes and reader iterations to help limit resource usage during fuzzing.
  • Keep the fuzzing project in rust/fuzz with an independent Cargo workspace.

Testing

  • Built the fuzz targets with cargo +nightly fuzz build.
  • Checked formatting with cargo fmt --manifest-path rust/fuzz/Cargo.toml -- --check.

Note: Fuzz target execution on Windows is currently blocked by a runtime DLL error (STATUS_DLL_NOT_FOUND). The targets compile, but successful fuzzing runs have not yet been verified.

@james-rms

Copy link
Copy Markdown
Collaborator

Hi @manas765 , thanks for the PR! this doesn't look ready to merge yet - before we review this in detail could you justify this change in your PR description? It's not clear so far what you think others should use this for or what bugs you've found using it.

@james-rms james-rms left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On second thought, I don't think we're ready to merge this without some further agreement on the high-level approach we would take to fuzzing the libraries. Keeping a fuzzing harness upstream isn't useful IMO unless we're regularly exercising it along with new changes to the library, and that the approach is compatible with the libraries for all languages.

@nrsandoval1231-oss

Copy link
Copy Markdown

Thanks for picking this up — the three targets here cover the linear paths and the summary parser called for in #1907 well.

One gap worth considering while this is open: an IndexedReader target. The indexed path is the one reader that (until #1874 is fixed) silently accepts corrupted chunk data, and #1927 adds chunk-CRC validation there, which is exactly the kind of logic fuzzing catches regressions in. A driver would need to answer ReadChunkRequests from the input buffer (or bail cleanly on out-of-bounds offsets) and cap inserted bytes, similar to the bounds you added for the linear targets. Happy to see it land here rather than in a competing PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants