win-pvdrivers

changeset 898:dab0168f43c6 0.11.0.286

Fix a crash on unaligned buffer access in storport. This was occuring during a format operation under 2008R2.
author James Harper <james.harper@bendigoit.com.au>
date Wed Mar 30 11:07:33 2011 +1100 (2011-03-30)
parents 0b3220aea661
children 5b2eff9d3941
files xenvbd/xenvbd_storport.c
line diff
     1.1 --- a/xenvbd/xenvbd_storport.c	Fri Mar 25 20:12:55 2011 +1100
     1.2 +++ b/xenvbd/xenvbd_storport.c	Wed Mar 30 11:07:33 2011 +1100
     1.3 @@ -561,12 +561,12 @@ XenVbd_PutQueuedSrbsOnRing(PXENVBD_DEVIC
     1.4        if ((ULONG_PTR)shadow->system_address & 511)
     1.5        {
     1.6          xvdd->aligned_buffer_in_use = TRUE;
     1.7 +        /* limit to aligned_buffer_size */
     1.8 +        block_count = min(block_count, xvdd->aligned_buffer_size / 512);
     1.9          ptr = (PUCHAR)xvdd->aligned_buffer;
    1.10          if (!decode_cdb_is_read(srb))
    1.11            memcpy(ptr, shadow->system_address, block_count * 512);
    1.12          shadow->aligned_buffer_in_use = TRUE;
    1.13 -        /* limit to aligned_buffer_size */
    1.14 -        block_count = min(block_count, xvdd->aligned_buffer_size / 512);
    1.15        }
    1.16        else
    1.17        {