VirtualBox

Changeset 93200 in vbox for trunk


Ignore:
Timestamp:
Jan 12, 2022 1:51:29 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/alloc-r0drv-nt.cpp: Must apply the NonPagePoolNx selection to both branches in rtR0MemAllocEx. (Yes, g_uRtNtVersion is the first thing that rtR0InitNative sets, so we shouldn't be called before it has a reasonably correct value.) bugref:10162

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp

    r93115 r93200  
    4646    if (!(fFlags & RTMEMHDR_FLAG_ANY_CTX))
    4747    {
    48         PRTMEMHDR pHdr;
     48        PRTMEMHDR       pHdr;
     49        POOL_TYPE const enmPoolType = !(fFlags & RTMEMHDR_FLAG_EXEC) && g_uRtNtVersion >= RTNT_MAKE_VERSION(8,0)
     50                                    ? NonPagedPoolNx : NonPagedPool;
    4951        if (g_pfnrtExAllocatePoolWithTag)
    50         {
    51             if (!(fFlags & RTMEMHDR_FLAG_EXEC) && g_uRtNtVersion >= RTNT_MAKE_VERSION(8,0))
    52                 pHdr = (PRTMEMHDR)g_pfnrtExAllocatePoolWithTag(NonPagedPoolNx, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG);
    53             else
    54                 pHdr = (PRTMEMHDR)g_pfnrtExAllocatePoolWithTag(NonPagedPool, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG);
    55         }
     52            pHdr = (PRTMEMHDR)g_pfnrtExAllocatePoolWithTag(enmPoolType, cb + sizeof(*pHdr), IPRT_NT_POOL_TAG);
    5653        else
    5754        {
    5855            fFlags |= RTMEMHDR_FLAG_UNTAGGED;
    59             pHdr = (PRTMEMHDR)ExAllocatePool(NonPagedPool, cb + sizeof(*pHdr));
     56            pHdr = (PRTMEMHDR)ExAllocatePool(enmPoolType, cb + sizeof(*pHdr));
    6057        }
    6158        if (pHdr)
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