VirtualBox

Changeset 46819 in vbox


Ignore:
Timestamp:
Jun 27, 2013 7:52:59 AM (12 years ago)
Author:
vboxsync
Message:

Storage/AHCI: Fix crash when guest uses READ(10) with a 2352 byte sector size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r46738 r46819  
    40804080    uint8_t *pbBufDst;
    40814081    uint8_t *pbBufSrc  = (uint8_t *)pAhciReq->u.Io.DataSeg.pvSeg;
    4082 
    4083     pbBuf = (uint8_t *)RTMemAlloc(pAhciReq->cbTransfer);
     4082    size_t cbAlloc = pAhciReq->cbTransfer + cSectors * (1 + 11 + 3 + 1 + 288); /* Per sector data like ECC. */
     4083
     4084    pbBuf = (uint8_t *)RTMemAlloc(cbAlloc);
    40844085    if (RT_UNLIKELY(!pbBuf))
    40854086        return VERR_NO_MEMORY;
     
    41074108
    41084109    *ppvProc = pbBuf;
    4109     *pcbProc = pAhciReq->cbTransfer;
     4110    *pcbProc = cbAlloc;
    41104111
    41114112    return VINF_SUCCESS;
     
    53605361            if (RT_SUCCESS(rc))
    53615362            {
    5362                 ahciCopyToPrdtl(pDevIns, pAhciReq, pv, cb);
     5363                pAhciReq->cbTransfer = ahciCopyToPrdtl(pDevIns, pAhciReq, pv, cb);
    53635364                RTMemFree(pv);
    53645365            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette