VirtualBox

Changeset 81231 in vbox


Ignore:
Timestamp:
Oct 13, 2019 12:59:17 PM (5 years ago)
Author:
vboxsync
Message:

Storage/DevVirtioScsi.cpp: Disabled MSI-X and added guards to virtioScsioReqCopy*() functions. See bugref:9440 Comment 108

Location:
trunk/src/VBox/Devices
Files:
2 edited

Legend:

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

    r81122 r81231  
    696696    RT_NOREF2(hIoReq, pInterface);
    697697    PVIRTIOSCSIREQ pReq = (PVIRTIOSCSIREQ)pvIoReqAlloc;
    698     if (pReq->pbDataIn)
    699         RTSgBufCopyToBuf(pSgBuf, pReq->pbDataIn + offDst, cbCopy);
     698
     699    AssertReturn(pReq->pbDataIn
     700                 && offDst + cbCopy <= pReq->cbDataIn
     701                 && cbCopy <= pSgBuf->cbSegLeft,  VERR_INVALID_PARAMETER);
     702
     703    RTSgBufCopyToBuf(pSgBuf, pReq->pbDataIn + offDst, cbCopy);
     704
    700705    return VINF_SUCCESS;
    701706}
     
    709714    RT_NOREF2(hIoReq, pInterface);
    710715    PVIRTIOSCSIREQ pReq = (PVIRTIOSCSIREQ)pvIoReqAlloc;
    711     if (pReq->pbDataOut)
    712         RTSgBufCopyFromBuf(pSgBuf, pReq->pbDataOut + offSrc, cbCopy);
     716
     717    AssertReturn(pReq->pbDataOut
     718                 && offSrc + cbCopy <= pReq->cbDataOut
     719                 && cbCopy <= pSgBuf->cbSegLeft,  VERR_INVALID_PARAMETER);
     720
     721    RTSgBufCopyFromBuf(pSgBuf, pReq->pbDataOut + offSrc, cbCopy);
    713722
    714723    return VINF_SUCCESS;
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r81126 r81231  
    108108int virtioQueueGet(VIRTIOHANDLE hVirtio, uint16_t qIdx, PPVIRTIO_DESC_CHAIN_T ppDescChain,  bool fRemove)
    109109{
    110     Assert(ppDescChain);
     110    AssertReturn(ppDescChain, VERR_INVALID_PARAMETER);
    111111
    112112    PVIRTIOSTATE pVirtio = (PVIRTIOSTATE)hVirtio;
     
    10401040    }
    10411041
    1042 #ifdef VBOX_WITH_MSI_DEVICES
     1042#if 0 /* Until pdmR3DvHlp_PCISetIrq() impl is fixed and Assert that limits vec to 0 is removed */
     1043# ifdef VBOX_WITH_MSI_DEVICES
    10431044    pVirtio->fMsiSupport = true;
     1045# endif
    10441046#endif
    10451047
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