Virtual Storport Tweaks

Just finished reading this article. I have a question: How should the driver respond when the srb transfer length is less than the cdb transfer length? Should the driver copy as much as it can (srb transfer length), and return some sort of overrun error, or fail the request?

IIRC (it’s been a long time)… You simply limit the transfer to that requested in the SRB (not the CDB) and let someone else worry about it.

If nobody else has data on this, I can go back and look at the code to see what we did.
Peter
OSR
@OSRDrivers

@Jamey Kirby:

“What
this means is that when the Storport Virtual Miniport gets a request, for
example a read or write, it needs to get the length of the transfer described in
the CDB and ensure that the SRB DataTransferLength field is large enough.”

CDB and SRB describe different layers. CDB is meant for a target, SRB is for the transport. The transport must not place data beyond the provided buffer (DataTransferLength), no matter what the target does. The transport is not supposed to parse CDBs and try to figure out if the buffer is big enough. It should simply set OVERRUN error when the target is trying to transfer more data than buffer size.

No worries, I did the same thing. Read what it can and let someone else
worry about it. I’m cleaning up an old virtual storport driver that I
wrote, and ran across your article, so I went through and fixed a few
things.

On Wed, May 17, 2017 at 7:14 AM wrote:

> IIRC (it’s been a long time)… You simply limit the transfer to that
> requested in the SRB (not the CDB) and let someone else worry about it.
>
> If nobody else has data on this, I can go back and look at the code to see
> what we did.
> Peter
> OSR
> @OSRDrivers
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:>