fuzz: fix kernel_params crashes and add missing mount_parsing target - #190
Merged
Conversation
kernel_params fuzzer was reporting intentional fail-fast panics (invalid u32 for lgc/lmc/pl) as crashes; wrap in catch_unwind so libFuzzer focuses on unexpected panics in the parsing logic. mount_parsing target was referenced in the CI matrix but never existed; expose fs_available as pub and add the fuzz target + Cargo.toml entry. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com> Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the fuzzing surface for NVRC’s parsing logic by (1) making kernel-params fuzzing ignore intentional “fail-fast” panics, and (2) adding the missing /proc/filesystems parsing fuzz target that CI already references.
Changes:
- Wrap the
kernel_paramsfuzz harness incatch_unwindto avoid treating intended validation panics as fuzz crashes. - Expose
mount::fs_availableand add a newmount_parsingfuzz target plus its[[bin]]entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/mount.rs | Makes fs_available public so it can be called from fuzz targets. |
| fuzz/fuzz_targets/mount_parsing.rs | Adds fuzz target for /proc/filesystems parsing/availability checks. |
| fuzz/fuzz_targets/kernel_params.rs | Adjusts fuzz harness to avoid failing on intended “fail-fast” panics. |
| fuzz/Cargo.toml | Registers the new mount_parsing fuzz binary target. |
fs_available: match exact last token per line instead of substring so "mp" no longer false-positives against "tmpfs"; empty fstype returns false. kernel_params harness: re-raise panics whose message does not contain "nvrc.smi." so genuine parser bugs still surface as libFuzzer crashes. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com> Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
fuzz (kernel_params): libFuzzer was treating intentional fail-fast panics as crashes. Invalid values fornvrc.smi.lgc,nvrc.smi.lmc, andnvrc.smi.plcorrectly panic (bad cmdline must reboot the VM per the architecture). Wrapped the fuzz harness incatch_unwindso libFuzzer focuses on unexpected panics in the parsing and splitting logic, not the validation path.fuzz (mount_parsing): target was referenced in the CI matrix but never existed. Exposedfs_availableaspuband added the fuzz target (fuzz/fuzz_targets/mount_parsing.rs) plus the[[bin]]entry infuzz/Cargo.toml.Test plan
kernel_paramsandmount_parsingjobs complete without crash artifactscargo buildcleancargo clippyclean