VirtualBox

Changeset 3466 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jul 5, 2007 1:23:14 PM (18 years ago)
Author:
vboxsync
Message:

Wrong locking for read-only memory in Windows guests.

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp

    r3307 r3466  
    179179                       These kind of problems actually applies to some patched linux kernels too, including older
    180180                       fedora releases. (The patch is the infamous 4G/4G patch, aka 4g4g, by Ingo Molnar.) */
    181                     rc = vbglLockLinear (&apvCtx[iParm], (void *)pParm->u.Pointer.u.linearAddr, pParm->u.Pointer.size);
     181                    rc = vbglLockLinear (&apvCtx[iParm], (void *)pParm->u.Pointer.u.linearAddr, pParm->u.Pointer.size, (pParm->type == VMMDevHGCMParmType_LinAddr_In) ? false : true /* write access */);
    182182                   
    183183                    if (VBOX_FAILURE (rc))
  • trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp

    r3306 r3466  
    3232
    3333
    34 int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size)
     34int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess)
    3535{
    3636    int rc = VINF_SUCCESS;
     
    4949            MmProbeAndLockPages (pMdl,
    5050                                 KernelMode,
    51                                  IoModifyAccess);
     51                                 (fWriteAccess) ? IoModifyAccess : IoReadAccess);
    5252                                 
    5353            *ppvCtx = pMdl;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.h

    r3306 r3466  
    6161} VBGLDRIVER;
    6262
    63 int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size);
     63int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess);
    6464void vbglUnlockLinear (void *pvCtx, void *pv, uint32_t u32Size);
    6565
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