VirtualBox

Changeset 77172 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Feb 6, 2019 11:38:04 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128656
Message:

IRPT/alloc-r0drv-nt.cpp: Make sure we free early untagged allocations with the untagged free function, otherwise checked kernels will be unhappy with us. ticketref:18187

Location:
trunk/src/VBox/Runtime/r0drv
Files:
2 edited

Legend:

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

    r76585 r77172  
    7575/** Linux: Allocated by kmalloc() instead of vmalloc(). */
    7676# define RTMEMHDR_FLAG_KMALLOC      RT_BIT(31)
     77#elif defined(RT_OS_WINDOWS)
     78/** Windows: Untagged allocation by ExAllocatePool, freed using ExFreePool. */
     79# define RTMEMHDR_FLAG_UNTAGGED     RT_BIT(31)
    7780#endif
    7881/** @} */
  • trunk/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp

    r76553 r77172  
    5555        }
    5656        else
     57        {
     58            fFlags |= RTMEMHDR_FLAG_UNTAGGED;
    5759            pHdr = (PRTMEMHDR)ExAllocatePool(NonPagedPool, cb + sizeof(*pHdr));
     60        }
    5861        if (pHdr)
    5962        {
     
    7679DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr)
    7780{
    78     pHdr->u32Magic += 1;
    79     if (g_pfnrtExFreePoolWithTag)
     81    pHdr->u32Magic = RTMEMHDR_MAGIC_DEAD;
     82    if (g_pfnrtExFreePoolWithTag && !(pHdr->fFlags & RTMEMHDR_FLAG_UNTAGGED))
    8083        g_pfnrtExFreePoolWithTag(pHdr, IPRT_NT_POOL_TAG);
    8184    else
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