[nvme_driver] set width limits on fields in nvme_driver fuzzer - #4402
[nvme_driver] set width limits on fields in nvme_driver fuzzer#4402Hadi Orabi (babayet2) wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The functional change correctly constrains fuzz input to the specified field width, with only a minor doc-comment mismatch noted.
Pull request overview
This PR reduces false-positive panics in the nvme_driver fuzzer by constraining reservation command “action” inputs to the actual bit-width defined by the NVMe spec bitfields.
Changes:
- Added a shared
RESERVATION_ACTION_MAXconstant (derived from a 3-bit field width) in the NVMe spec definitions, with compile-time assertions tying it to the relevant bitfields. - Updated the nvme_driver fuzzer’s
Arbitrarygeneration for reservation action fields to only generate values within0..=RESERVATION_ACTION_MAX.
File summaries
| File | Description |
|---|---|
| vm/devices/storage/nvme_spec/src/nvm.rs | Exposes a max-value constant for reservation action field width and adds compile-time consistency checks with the bitfield definitions. |
| vm/devices/storage/disk_nvme/nvme_driver/fuzz/fuzz_nvme_driver.rs | Limits fuzz-generated reservation action values to the defined 3-bit range to avoid width-related panics. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, clearly scoped to eliminating fuzzer-only false positives, and include compile-time invariants to prevent future drift.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
This PR stops the nvme_driver fuzzer from creating false positives panics. Previously, the fuzzer would submit reservation commands with 8-bit action fields, though the field is only 3 bits wide.