Skip to content

fuzz_nvme_driver: add Deallocate action, simplify guid#3030

Open
mattkur wants to merge 3 commits intomicrosoft:mainfrom
mattkur:fuzz-nvme-optimize
Open

fuzz_nvme_driver: add Deallocate action, simplify guid#3030
mattkur wants to merge 3 commits intomicrosoft:mainfrom
mattkur:fuzz-nvme-optimize

Conversation

@mattkur
Copy link
Contributor

@mattkur mattkur commented Mar 17, 2026

Adds Deallocate action variant, simplifies arbitrary_guid, passthroughs max_interrupt_count (fuzzed values hung the driver, see #3022).

…ax_interrupt_count

Why is this change being made?
- Deallocate (DSM) was only called once at shutdown with hardcoded values
- arbitrary_guid made 11 separate arbitrary_data calls (lock/unlock each)
- max_interrupt_count fuzzing caused driver hangs (see microsoft#3022)

What changed?
- Added Deallocate action variant with arbitrary target_cpu, context_attributes,
  starting_lba, and lba_count fields
- Removed hardcoded shutdown deallocate (now covered by action loop)
- Simplified arbitrary_guid: single [u8; 16] call instead of 11 calls
- Changed max_interrupt_count to passthrough (fuzzed values hang the driver
  due to missing CAP.TO timeout, tracked in microsoft#3022)

How was the change tested?
- ✅ cargo clippy --all-targets -p fuzz_nvme_driver (clean)
- ✅ cargo xtask fmt --fix (clean)
- ✅ No hangs in 93-minute campaign (previous version had 732 timeouts)
@mattkur mattkur requested review from a team as code owners March 17, 2026 18:21
Copilot AI review requested due to automatic review settings March 17, 2026 18:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new fuzz action for NVMe DSM deallocation, simplifies GUID generation from arbitrary bytes, and avoids fuzzing max_interrupt_count to prevent driver hangs described in #3022.

Changes:

  • Add NvmeDriverAction::Deallocate and wire it into the fuzz action handler.
  • Simplify arbitrary_guid() to build a Guid from 16 arbitrary bytes.
  • Always pass through max_interrupt_count() in the emulated device to avoid NvmeDriver::new() hangs.

Reviewed changes

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

File Description
vm/devices/storage/disk_nvme/nvme_driver/fuzz/fuzz_nvme_driver.rs Adds Deallocate action handling and refactors GUID generation.
vm/devices/storage/disk_nvme/nvme_driver/fuzz/fuzz_emulated_device.rs Stops fuzzing max_interrupt_count() to prevent initialization hangs.

- Generate Guid fields individually instead of slicing a [u8; 16], removing
  unwrap() calls (smalis + copilot feedback)
- Update doc comment to note Result error case
@github-actions
Copy link

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.

5 participants