VirtualBox

Changeset 4057 in vbox for trunk/src/VBox/VMM/PATM


Ignore:
Timestamp:
Aug 7, 2007 10:05:48 AM (17 years ago)
Author:
vboxsync
Message:

Don't allow popf instructions to change the current IOPL in simple (cli) patches. (see defect 2042)

Location:
trunk/src/VBox/VMM/PATM
Files:
3 edited

Legend:

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

    r3696 r4057  
    17571757
    17581758        /* Not an exit point for IDT handler or function replacement patches */
     1759        /* Note: keep IOPL in mind when changing any of this!! (see comments in PATMA.asm, PATMPopf32Replacement) */
    17591760        if (pPatch->flags & (PATMFL_IDTHANDLER|PATMFL_DUPLICATE_FUNCTION))
    17601761            fGenerateJmpBack = false;
  • trunk/src/VBox/VMM/PATM/PATMA.asm

    r3696 r4057  
    737737
    738738PATMPopf32_Ok:
    739     pop     dword [ss:PATM_VMFLAGS]
    740     push    dword [ss:PATM_VMFLAGS]
     739    ; Note: we don't allow popf instructions to change the current IOPL; we simply ignore such changes (!!!)
     740    ; In this particular patch it's rather unlikely the pushf was included, so we have no way to check if the flags on the stack are correctly synched
     741    ; PATMPopf32Replacement_NoExit is different, because it's only used in IDT and function patches
    741742
    742743    ; if interrupts are pending, then we must go back to the host context to handle them!
     
    776777    DD      PATMPopf32End - PATMPopf32Start
    777778%ifdef PATM_LOG_PATCHINSTR
    778     DD      13
     779    DD      11
    779780%else
    780     DD      12
     781    DD      10
    781782%endif
    782783    DD      PATM_INTERRUPTFLAG
     
    787788%endif
    788789    DD      PATM_INTERRUPTFLAG
    789     DD      0
    790     DD      PATM_VMFLAGS
    791     DD      0
    792     DD      PATM_VMFLAGS
    793790    DD      0
    794791    DD      PATM_VM_FORCEDACTIONS
  • trunk/src/VBox/VMM/PATM/PATMPatch.cpp

    r3020 r4057  
    475475    Log(("patmPatchGenPopf at %VGv\n", pReturnAddrGC));
    476476
    477     /** @todo check if we mess up IOPL here (theoretical possibility afaik) */
     477    /* Note: keep IOPL in mind when changing any of this!! (see comments in PATMA.asm, PATMPopf32Replacement) */
    478478    if (fSizeOverride == true)
    479479    {
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