-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] nvme_driver: fix overflow computing queue size and don't wait for bad devices forever #682
base: main
Are you sure you want to change the base?
[DRAFT] nvme_driver: fix overflow computing queue size and don't wait for bad devices forever #682
Conversation
please add a description for the change. |
I would also ask you to add a test here, but I know that you found these with changes in the nvme driver fuzzer you're working on. So, I think getting that fuzzer changes is a decent test and the best test ROI. |
@@ -116,6 +126,9 @@ impl<T: DeviceRegisterIo + Inspect> Bar0<T> { | |||
if u32::from(csts) == !0 { | |||
break false; | |||
} | |||
if start.elapsed() >= timeout { | |||
break false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caller seems to rely on this actually resetting the device before it frees buffers. With this change, you might now return with the device still referencing these buffers. And that can lead to memory corruption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Hold onto responses until the reset completes so that waiting IOs do
// not think the memory is unaliased by the device.
The PR title is misleading--it implies that this is primarily a change to the fuzzer. But the meaningful changes are to the driver. It should be prefixed with "nvme_driver", not "fuzz_nvme_driver". |
I was already changing it, but @gurasinghMS : I want to echo this feedback for future reference (see my suggested new title as an example) |
Are we worried about the timeout causing additional issues in a virtualized environment under load? What's the |
Yeah, I am concerned about this. But mostly in the sense that we'd read some huge value and hang for a very long time. That reduces down to the current behavior if you shrink your observation time window (we currently hang forever...). Are you concerned about a |
Yes. |
vm/devices/storage/disk_nvme/nvme_driver/fuzz/fuzz_nvme_driver.rs
Outdated
Show resolved
Hide resolved
vm/devices/storage/disk_nvme/nvme_driver/fuzz/fuzz_nvme_driver.rs
Outdated
Show resolved
Hide resolved
Pausing work on the PCIe interface fuzzing and marking this PR as a Draft for the time being. Will pick this work back up after working on the NVMe interface fuzzing. |
When running the fuzzer locally I came across two bugs causing a panic and a timeout respectively.