VirtualBox

Changeset 65623 in vbox


Ignore:
Timestamp:
Feb 6, 2017 2:02:15 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113295
Message:

IEM: Selector checks for memory access raise #GP, not #NP. See bugref:5653:83

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r65612 r65623  
    52665266{
    52675267    return iemRaiseXcptOrInt(pVCpu, 0, X86_XCPT_NP, IEM_XCPT_FLAGS_T_CPU_XCPT | IEM_XCPT_FLAGS_ERR, uErr, 0);
    5268 }
    5269 
    5270 
    5271 /** \#NP(seg) - 0b.  */
    5272 DECL_NO_INLINE(IEM_STATIC, VBOXSTRICTRC) iemRaiseSelectorNotPresentBySegReg(PVMCPU pVCpu, uint32_t iSegReg)
    5273 {
    5274     return iemRaiseXcptOrInt(pVCpu, 0, X86_XCPT_NP, IEM_XCPT_FLAGS_T_CPU_XCPT | IEM_XCPT_FLAGS_ERR,
    5275                              iemSRegFetchU16(pVCpu, iSegReg) & ~X86_SEL_RPL, 0);
    52765268}
    52775269
     
    74337425        if (!pHid->Attr.n.u1Present)
    74347426        {
    7435             Log(("iemMemSegCheckWriteAccessEx: %#x (index %u) - segment not present -> #NP\n", iemSRegFetchU16(pVCpu, iSegReg), iSegReg));
    7436             return iemRaiseSelectorNotPresentBySegReg(pVCpu, iSegReg);
     7427            uint16_t    uSel = iemSRegFetchU16(pVCpu, iSegReg);
     7428            AssertRelease(uSel == 0);
     7429            Log(("iemMemSegCheckWriteAccessEx: %#x (index %u) - bad selector -> #GP\n", uSel, iSegReg));
     7430            return iemRaiseGeneralProtectionFault0(pVCpu);
    74377431        }
    74387432
     
    74697463        if (!pHid->Attr.n.u1Present)
    74707464        {
    7471             Log(("iemMemSegCheckReadAccessEx: %#x (index %u) - segment not present -> #NP\n", iemSRegFetchU16(pVCpu, iSegReg), iSegReg));
    7472             return iemRaiseSelectorNotPresentBySegReg(pVCpu, iSegReg);
     7465            uint16_t    uSel = iemSRegFetchU16(pVCpu, iSegReg);
     7466            AssertRelease(uSel == 0);
     7467            Log(("iemMemSegCheckReadAccessEx: %#x (index %u) - bad selector -> #GP\n", uSel, iSegReg));
     7468            return iemRaiseGeneralProtectionFault0(pVCpu);
    74737469        }
    74747470
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