VirtualBox

Changeset 104280 in vbox


Ignore:
Timestamp:
Apr 10, 2024 4:48:47 PM (10 months ago)
Author:
vboxsync
Message:

VirtioCore: improved chain length checks and MMIO read handling in PciIch0 and PCNet, as well as input context initialization in XHCI. bugref:10635

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r103005 r104280  
    731731            default:
    732732                ASSERT_GUEST_MSG_FAILED(("cb=%u off=%RGp\n", cb, off)); /** @todo how the heck should this work? Split it, right? */
     733                rcStrict = VINF_IOM_MMIO_UNUSED_00;
    733734                break;
    734735        }
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r99739 r104280  
    38143814            case 4:  rc = pcnetR3MmioReadU32(pDevIns, pThis, pThisCC, off, (uint32_t *)pv); break;
    38153815            default:
     3816                memset(pv, 0, cb);
    38163817                rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "pcnetR3MmioRead: unsupported op size: address=%RGp cb=%u\n", off, cb);
     3818                break;
    38173819        }
    38183820        STAM_PROFILE_ADV_STOP(&pThis->CTX_SUFF_Z(StatMMIORead), a);
  • trunk/src/VBox/Devices/USB/DevXHCI.cpp

    r104125 r104280  
    45644564    unsigned        uDCI;
    45654565
     4566    RT_ZERO(dc_inp);
     4567
    45664568    Assert(uSlotID);
    45674569    LogFlowFunc(("Slot ID %u, input control context @ %RGp\n", uSlotID, GCPhysInpCtx));
     
    46454647            /// @todo Check input EP contexts according to 6.2.3.2
    46464648        }
    4647 /** @todo r=bird: Looks like MSC is right that dc_inp can be used uninitalized.
    4648  *
    4649  * However, this function is so hard to read I'm leaving the exorcism of it to
    4650  * the author and just zeroing it in the mean time.
    4651  *
    4652  */
    4653         else
    4654             RT_ZERO(dc_inp);
    4655 
    46564649        /* Read the output Slot Context plus all Endpoint Contexts up to and
    46574650         * including the one with the highest 'add' or 'drop' bit set.
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp

    r102875 r104280  
    865865            break;
    866866        }
     867        /* Check if the limit has been reached for input chain (see section 2.4.4.1 of virtio 1.0 spec). */
     868        if (cSegsIn >= RT_ELEMENTS(pVirtqBuf->aSegsIn))
     869        {
     870            LogRelMax(64, ("Too many input descriptors (cSegsIn=%u).\n", cSegsIn));
     871            break;
     872        }
     873        /* Check if the limit has been reached for output chain (see section 2.4.4.1 of virtio 1.0 spec). */
     874        if (cSegsOut >= RT_ELEMENTS(pVirtqBuf->aSegsOut))
     875        {
     876            LogRelMax(64, ("Too many output descriptors (cSegsOut=%u).\n", cSegsOut));
     877            break;
     878        }
    867879        RT_UNTRUSTED_VALIDATED_FENCE();
    868880
     
    19781990    PVIRTIOCORE   pVirtio   = PDMINS_2_DATA(pDevIns, PVIRTIOCORE);
    19791991    PVIRTIOCORECC pVirtioCC = PDMINS_2_DATA_CC(pDevIns, PVIRTIOCORECC);
    1980     AssertReturn(cb == 1 || cb == 2 || cb == 4, VERR_INVALID_PARAMETER);
     1992    AssertReturn(cb == 1 || cb == 2 || cb == 4, VINF_IOM_MMIO_UNUSED_FF);
    19811993    Assert(pVirtio == (PVIRTIOCORE)pvUser); RT_NOREF(pvUser);
    19821994
     
    20002012    {
    20012013        ASSERT_GUEST_MSG_FAILED(("Bad read access to mapped capabilities region: off=%RGp cb=%u\n", off, cb));
     2014        memset(pv, 0xFF, cb);
    20022015        rcStrict = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS,
    20032016                                     "virtioMmioRead: Bad MMIO access to capabilities, offset=%RTiop cb=%08x\n", off, cb);
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