VirtualBox

Changeset 1918 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 4, 2007 10:02:24 AM (18 years ago)
Author:
vboxsync
Message:

Always check if the code selector is wide open. Refuse patching if that's not the case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r1917 r1918  
    39163916    uint32_t opsize;
    39173917    PPATMPATCHREC pPatchRec;
     3918    PCPUMCTX pCtx = 0;
    39183919    bool disret;
    39193920    int rc;
     
    39483949        return VERR_PATCHING_REFUSED;
    39493950
    3950 #ifdef VBOX_STRICT
    3951     PCPUMCTX pCtx = 0;
    3952 
     3951    /* Make sure the code selector is wide open; otherwise refuse. */
    39533952    CPUMQueryGuestCtxPtr(pVM, &pCtx);
    3954 
    3955     if (    !pCtx->eflags.Bits.u1VM
    3956         &&  (pCtx->ss & X86_SEL_RPL) == 0)
    3957     {
    3958         RTGCPTR pInstrGCFlat = SELMToFlat(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid, pInstrGC);
    3959         AssertMsg(pInstrGCFlat == pInstrGC, ("%04x:%VGv != %VGv eflags=%08x\n", pCtx->cs, pInstrGCFlat, pInstrGC, pCtx->eflags.u32));
    3960     }
    3961 #endif
     3953    Assert(!pCtx->eflags.Bits.u1VM && (pCtx->ss & X86_SEL_RPL) == 0);
     3954    RTGCPTR pInstrGCFlat = SELMToFlat(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid, pInstrGC);
     3955    AssertMsgReturn(pInstrGCFlat == pInstrGC, ("%04x:%VGv != %VGv eflags=%08x\n", pCtx->cs, pInstrGCFlat, pInstrGC, pCtx->eflags.u32), VERR_PATCHING_REFUSED);
    39623956
    39633957    /** @note the OpenBSD specific check will break if we allow additional patches to be installed (int 3)) */
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