VirtualBox

Ignore:
Timestamp:
Jan 17, 2022 12:34:44 PM (3 years ago)
Author:
vboxsync
Message:

SUPDrv/win: A few more things to ignore when loading images with -guard:cf enabled. bugref:10162

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r93251 r93273  
    25292529        uint32_t    uRva;
    25302530        uint32_t    cb;
    2531     }               aRegions[16];
     2531    }               aRegions[20];
    25322532} SUPDRVNTEXCLREGIONS;
    25332533
     
    26682668                && pCfg->SecurityCookie != NULL)
    26692669                supdrvNtAddExclRegion(&ExcludeRegions, (uintptr_t)pCfg->SecurityCookie - (uintptr_t)pImage->pvImage, sizeof(void *));
     2670
     2671            /* Also exclude the GuardCFCheckFunctionPointer and GuardCFDispatchFunctionPointer pointer variables. */
     2672            if (   pCfg->Size >= RT_UOFFSET_AFTER(IMAGE_LOAD_CONFIG_DIRECTORY, GuardCFCheckFunctionPointer)
     2673                && pCfg->GuardCFCheckFunctionPointer != NULL)
     2674                supdrvNtAddExclRegion(&ExcludeRegions, (uintptr_t)pCfg->GuardCFCheckFunctionPointer - (uintptr_t)pImage->pvImage, sizeof(void *));
     2675            if (   pCfg->Size >= RT_UOFFSET_AFTER(IMAGE_LOAD_CONFIG_DIRECTORY, GuardCFDispatchFunctionPointer)
     2676                && pCfg->GuardCFDispatchFunctionPointer != NULL)
     2677                supdrvNtAddExclRegion(&ExcludeRegions, (uintptr_t)pCfg->GuardCFDispatchFunctionPointer - (uintptr_t)pImage->pvImage, sizeof(void *));
     2678
     2679            /* Ditto for the XFG variants: */
     2680            if (   pCfg->Size >= RT_UOFFSET_AFTER(IMAGE_LOAD_CONFIG_DIRECTORY, GuardXFGCheckFunctionPointer)
     2681                && pCfg->GuardXFGCheckFunctionPointer != NULL)
     2682                supdrvNtAddExclRegion(&ExcludeRegions, (uintptr_t)pCfg->GuardXFGCheckFunctionPointer - (uintptr_t)pImage->pvImage, sizeof(void *));
     2683            if (   pCfg->Size >= RT_UOFFSET_AFTER(IMAGE_LOAD_CONFIG_DIRECTORY, GuardXFGDispatchFunctionPointer)
     2684                && pCfg->GuardXFGDispatchFunctionPointer != NULL)
     2685                supdrvNtAddExclRegion(&ExcludeRegions, (uintptr_t)pCfg->GuardXFGDispatchFunctionPointer - (uintptr_t)pImage->pvImage, sizeof(void *));
     2686
     2687            /** @todo What about GuardRFVerifyStackPointerFunctionPointer and
     2688             * GuardRFFailureRoutineFunctionPointer? Ignore for now as the compiler we're
     2689             * using (19.26.28805) sets them to zero from what I can tell. */
    26702690
    26712691            /*
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