VirtualBox

Changeset 56424 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jun 15, 2015 9:59:55 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101026
Message:

VMM/GIM: Some extra checks while loading saved state and enabling system-time struct. in KVM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp

    r55929 r56424  
    351351        SSMR3GetGCPhys(pSSM, &pKvmCpu->GCPhysSystemTime);
    352352        SSMR3GetU32(pSSM, &pKvmCpu->u32SystemTimeVersion);
    353         SSMR3GetU8(pSSM, &fSystemTimeFlags);
     353        rc = SSMR3GetU8(pSSM, &fSystemTimeFlags);
     354        AssertRCReturn(rc, rc);
    354355
    355356        /* Enable the system-time struct. if necessary. */
     
    390391VMMR3_INT_DECL(int) gimR3KvmEnableSystemTime(PVM pVM, PVMCPU pVCpu, PGIMKVMCPU pKvmCpu, uint8_t fFlags)
    391392{
     393    /*
     394     * Validate the mapping address first.
     395     */
     396    if (!PGMPhysIsGCPhysNormal(pVM, pKvmCpu->GCPhysSystemTime))
     397    {
     398        LogRel(("GIM: KVM: VCPU%3d: Invalid physical addr requested for mapping system-time struct. GCPhysSystemTime=%#RGp\n",
     399                pKvmCpu->GCPhysSystemTime));
     400        return VERR_GIM_OPERATION_FAILED;
     401    }
     402
    392403    GIMKVMSYSTEMTIME SystemTime;
    393404    RT_ZERO(SystemTime);
     
    423434
    424435    Assert(!(SystemTime.u32Version & UINT32_C(1)));
    425     Assert(PGMPhysIsGCPhysNormal(pVM, pKvmCpu->GCPhysSystemTime));
    426436    int rc = PGMPhysSimpleWriteGCPhys(pVM, pKvmCpu->GCPhysSystemTime, &SystemTime, sizeof(GIMKVMSYSTEMTIME));
    427437    if (RT_SUCCESS(rc))
Note: See TracChangeset for help on using the changeset viewer.

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