VirtualBox

Changeset 93256 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Jan 17, 2022 12:14:27 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149318
Message:

/Config.kmk: Enable /GS for VBOXR3HARDENEDEXE when /guard is also enabled. bugref:10162

Location:
trunk/src/VBox/HostDrivers/Support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r93254 r93256  
    438438  ifneq ($(VBOX_VCC_LD_GUARD_CF),)
    439439   SUPR3HardenedStatic_SOURCES.win += \
     440        $(SUPR3HardenedStatic_0_OUTDIR)/loadcfg.obj
     441   # These are for the /guard option.
     442   SUPR3HardenedStatic_SOURCES.win += \
    440443        $(SUPR3HardenedStatic_0_OUTDIR)/loadcfg.obj \
    441444        $(SUPR3HardenedStatic_0_OUTDIR)/gs_cookie.obj \
     
    443446        $(SUPR3HardenedStatic_0_OUTDIR)/guard_dispatch.obj \
    444447        $(SUPR3HardenedStatic_0_OUTDIR)/guard_xfg_dispatch.obj
     448   # These next ones are for supporting the /GS option.  We skip gs_report.obj as it
     449   # import lots from kernel32 and we're better of reporting the problem ourselves.
     450   SUPR3HardenedStatic_SOURCES.win += \
     451        $(SUPR3HardenedStatic_0_OUTDIR)/amdsecgs.obj \
     452        $(SUPR3HardenedStatic_0_OUTDIR)/gshandler.obj
    445453
    446454$$(SUPR3HardenedStatic_0_OUTDIR)/loadcfg.obj \
     
    449457$$(SUPR3HardenedStatic_0_OUTDIR)/guard_dispatch.obj \
    450458$$(SUPR3HardenedStatic_0_OUTDIR)/guard_xfg_dispatch.obj \
     459$$(SUPR3HardenedStatic_0_OUTDIR)/amdsecgs.obj \
     460$$(SUPR3HardenedStatic_0_OUTDIR)/gs_report.obj \
     461$$(SUPR3HardenedStatic_0_OUTDIR)/gshandler.obj \
    451462        : \
    452463                $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/libcmt.lib | $$(dir $$@)
  • trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp

    r93115 r93256  
    485485}
    486486
     487
     488/**
     489 * Called when there is some /GS (or maybe /RTCsu) related stack problem.
     490 *
     491 * We don't want the CRT version living in gshandle.obj, as it uses a lot of
     492 * kernel32 imports, we want to report this error ourselves.
     493 */
     494extern "C" __declspec(noreturn guard(nosspro) guard(nossepi))
     495void __cdecl __report_rangecheckfailure(void)
     496{
     497    supR3HardenedFatal("__report_rangecheckfailure called from %p", ASMReturnAddress());
     498}
     499
     500
     501/**
     502 * Called when there is some /GS problem has been detected.
     503 *
     504 * We don't want the CRT version living in gshandle.obj, as it uses a lot of
     505 * kernel32 imports, we want to report this error ourselves.
     506 */
     507extern "C" __declspec(noreturn guard(nosspro) guard(nossepi))
     508#ifdef RT_ARCH_X86
     509void __cdecl __report_gsfailure(void)
     510#else
     511void __report_gsfailure(uintptr_t uCookie)
     512#endif
     513{
     514#ifdef RT_ARCH_X86
     515    supR3HardenedFatal("__report_gsfailure called from %p", ASMReturnAddress());
     516#else
     517    supR3HardenedFatal("__report_gsfailure called from %p, cookie=%p", ASMReturnAddress(), uCookie);
     518#endif
     519}
    487520
    488521
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