Windows: bound lower device I/O waits - #1808
Conversation
|
Thank you for digging into #1807 and putting together a concrete proposal. The idea of avoiding an indefinitely blocked VeraCrypt worker thread when a lower storage stack is wedged is valid, and the bounce-buffer/refcount direction shows real care. After reviewing the PR and the regression reports, I don't think this is the right fix to merge for #1807. My current assessment is that the 1.26.29 regression is more likely tied to recent driver I/O dispatch/queueing changes that landed after 1.26.24, especially:
I have pushed a more conservative fix to The main reason I don't think this PR covers #1807 is that the dump points to a pending request->Item->Status = ZwWriteFile (
queue->HostFileHandle,
NULL,
NULL,
NULL,
&ioStatus,
request->Data,
request->Length,
&request->Offset,
NULL);
Even as a separate hardening change, there are several issues that would need to be resolved first:
I'm going to close this PR rather than merge it for #1807. A bounded lower-device wait mechanism may still be worth exploring later as a separate hardening change, but it would need a design that handles initialization, MDL cleanup, cancellation/completion ownership, write semantics, and performance impact very carefully. Thanks again for the investigation and for taking the time to propose a concrete fix. |
Summary
Rationale
Issue #1807 reports a Windows storage hang where a thread is blocked on a pending write whose current driver is \Driver\veracrypt. The previous helper waited indefinitely for lower-device reads/writes, so a stalled USB/storage/filter-stack request could keep VeraCrypt's queue worker blocked indefinitely as well.
This does not assert that VeraCrypt alone causes the reported Bitdefender/exFAT/USB interaction. It makes VeraCrypt fail the lower I/O upward after a bounded wait instead of waiting forever.
Fixes #1807
Testing