Skip to content

fuzz: fix kernel_params crashes and add missing mount_parsing target - #190

Merged
zvonkok merged 2 commits into
NVIDIA:mainfrom
zvonkok:fix/fuzzing-failures
Jul 14, 2026
Merged

fuzz: fix kernel_params crashes and add missing mount_parsing target#190
zvonkok merged 2 commits into
NVIDIA:mainfrom
zvonkok:fix/fuzzing-failures

Conversation

@zvonkok

@zvonkok zvonkok commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fuzz (kernel_params): libFuzzer was treating intentional fail-fast panics as crashes. Invalid values for nvrc.smi.lgc, nvrc.smi.lmc, and nvrc.smi.pl correctly panic (bad cmdline must reboot the VM per the architecture). Wrapped the fuzz harness in catch_unwind so 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. Exposed fs_available as pub and added the fuzz target (fuzz/fuzz_targets/mount_parsing.rs) plus the [[bin]] entry in fuzz/Cargo.toml.

Test plan

  • Trigger the fuzzing workflow manually on this branch and confirm both kernel_params and mount_parsing jobs complete without crash artifacts
  • cargo build clean
  • cargo clippy clean

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>
Copilot AI review requested due to automatic review settings July 13, 2026 16:15

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 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_params fuzz harness in catch_unwind to avoid treating intended validation panics as fuzz crashes.
  • Expose mount::fs_available and add a new mount_parsing fuzz 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.

Comment thread src/mount.rs
Comment thread fuzz/fuzz_targets/kernel_params.rs Outdated
@zvonkok zvonkok added the ok-to-test Ok to test label Jul 13, 2026
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>
Copilot AI review requested due to automatic review settings July 13, 2026 19:02
@github-actions github-actions Bot removed the ok-to-test Ok to test label Jul 13, 2026

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread fuzz/fuzz_targets/kernel_params.rs
@zvonkok
zvonkok merged commit 2d682ba into NVIDIA:main Jul 14, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants