mesh_protobuf: Add a fuzzer#3756
Open
smalis-msft wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new mesh_protobuf fuzz target to exercise decode/round-trip/merge paths across a wide range of protobuf shapes, and includes a fix for incorrect zigzag decoding of some negative-number encodings.
Changes:
- Fix
unzigzag(u64) -> i64to correctly handle full-range zigzag encodings (including boundary values). - Add a dedicated
fuzz_mesh_protobufcrate/target to fuzz decode, round-trip, and merge across many representative types. - Register the new fuzz crate in the workspace and lockfile.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| support/mesh/mesh_protobuf/src/protobuf.rs | Fixes zigzag decode logic for signed varints. |
| support/mesh/mesh_protobuf/fuzz/fuzz_mesh_protobuf.rs | New fuzzer target exercising decode/round-trip/merge across many encodings/types. |
| support/mesh/mesh_protobuf/fuzz/Cargo.toml | Adds fuzz crate manifest/config and OneFuzz allowlist. |
| Cargo.toml | Adds the new fuzz crate to workspace members. |
| Cargo.lock | Adds lock entry for the new fuzz crate. |
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.
This found one bug already in our handling of negative number edge cases, a fix is included. I tried to make sure this had as much coverage as it can, hence the large number of different types. I also checked to make sure that this would've caught #2919.