win-pvdrivers

changeset 494:c431d22ff34b

Turned off sg. Checked for buffer overflow.
author James Harper <james.harper@bendigoit.com.au>
date Tue Dec 09 20:30:26 2008 +1100 (2008-12-09)
parents 750f70b8fa5c
children a6e3f76419c3
files xenscsi/xenscsi.c
line diff
     1.1 --- a/xenscsi/xenscsi.c	Tue Dec 09 20:29:44 2008 +1100
     1.2 +++ b/xenscsi/xenscsi.c	Tue Dec 09 20:30:26 2008 +1100
     1.3 @@ -471,8 +471,8 @@ XenScsi_HwScsiFindAdapter(PVOID DeviceEx
     1.4    }
     1.5  #endif
     1.6    
     1.7 -  ConfigInfo->ScatterGather = TRUE;
     1.8 -  ConfigInfo->NumberOfPhysicalBreaks = VSCSIIF_SG_TABLESIZE - 1;
     1.9 +  ConfigInfo->ScatterGather = FALSE;
    1.10 +  ConfigInfo->NumberOfPhysicalBreaks = 0; //VSCSIIF_SG_TABLESIZE - 1;
    1.11    ConfigInfo->MaximumTransferLength = VSCSIIF_SG_TABLESIZE * PAGE_SIZE;
    1.12    ConfigInfo->CachesData = FALSE;
    1.13    ConfigInfo->NumberOfBuses = 4; //SCSI_MAXIMUM_BUSES; //8
    1.14 @@ -588,6 +588,10 @@ XenScsi_PutSrbOnRing(PXENSCSI_DEVICE_DAT
    1.15  
    1.16    for (ptr = Srb->DataBuffer, shadow->req.nr_segments = 0; remaining != 0; shadow->req.nr_segments++)
    1.17    {
    1.18 +    if (shadow->req.nr_segments >= VSCSIIF_SG_TABLESIZE)
    1.19 +    {
    1.20 +      KdPrint((__DRIVER_NAME "     too many segments (length = %d, remaining = %d)\n", Srb->DataTransferLength, remaining));
    1.21 +    }
    1.22      physical_address = MmGetPhysicalAddress(ptr);
    1.23      pfn = (ULONG)(physical_address.QuadPart >> PAGE_SHIFT);
    1.24      shadow->req.seg[shadow->req.nr_segments].gref = get_grant_from_freelist(xsdd);