VirtualBox

Changeset 104170 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 5, 2024 8:53:01 AM (10 months ago)
Author:
vboxsync
Message:

Devices/LsiLogicSCSI: Respond with a device not there error if the CDB length for a SCSI I/O request is invalid, bugref:10613

File:
1 edited

Legend:

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

    r99775 r104170  
    22962296        PLSILOGICDEVICE pTgtDev = &pThisCC->paDeviceStates[pGuestReq->SCSIIO.u8TargetID];
    22972297
    2298         if (pTgtDev->pDrvBase)
     2298        if (   pTgtDev->pDrvBase
     2299            && pGuestReq->SCSIIO.u8CDBLength <= RT_ELEMENTS(pGuestReq->SCSIIO.au8CDB))
    22992300        {
    23002301            /* Allocate and prepare a new request. */
     
    23652366    if (g_cLogged++ < MAX_REL_LOG_ERRORS)
    23662367    {
    2367         LogRel(("LsiLogic#%d: %d/%d (Bus/Target) doesn't exist\n", pDevIns->iInstance,
    2368                 pGuestReq->SCSIIO.u8TargetID, pGuestReq->SCSIIO.u8Bus));
     2368        LogRel(("LsiLogic#%d: %d/%d/%d (Bus/Target/CDBLength) doesn't exist\n", pDevIns->iInstance,
     2369                pGuestReq->SCSIIO.u8TargetID, pGuestReq->SCSIIO.u8Bus, pGuestReq->SCSIIO.u8CDBLength));
    23692370        /* Log the CDB too  */
    23702371        LogRel(("LsiLogic#%d: Guest issued CDB {%#x",
    23712372                pDevIns->iInstance, pGuestReq->SCSIIO.au8CDB[0]));
    2372         for (unsigned i = 1; i < pGuestReq->SCSIIO.u8CDBLength; i++)
     2373        for (unsigned i = 1; i < RT_MIN(pGuestReq->SCSIIO.u8CDBLength, RT_ELEMENTS(pGuestReq->SCSIIO.au8CDB)); i++)
    23732374            LogRel((", %#x", pGuestReq->SCSIIO.au8CDB[i]));
    23742375        LogRel(("}\n"));
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