Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 4  
16 May 17 23:44
Jamey Kirby
xxxxxx@gmail.com
Join Date: 31 Dec 2014
Posts To This List: 244
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? <quote> Validating the SRB DataTransferLength Another interesting busTRACE find was that the Storport Virtual Miniport Driver was not validating that the size of the buffer described by the SRBs? DataTransferLength field was large enough to hold the data requested. 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. Failure to make this check would lead to crashes or data corruption since the driver could attempt to access past the end of the allocated buffer. </quote>
  Message 2 of 4  
17 May 17 07:14
Peter Viscarola (OSR)
xxxxxx@osr.com
Join Date:
Posts To This List: 5949
List Moderator
Virtual Storport Tweaks

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
  Message 3 of 4  
17 May 17 10:34
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3218
Virtual Storport Tweaks

@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.
  Message 4 of 4  
17 May 17 11:39
Jamey Kirby
xxxxxx@gmail.com
Join Date: 31 Dec 2014
Posts To This List: 244
Virtual Storport Tweaks

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 <xxxxx@osr.com> 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 > > <...excess quoted lines suppressed...> --
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 04:22.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license