VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/StackCheckLib/StackCheckLibCommonGcc.c@ 109091

Last change on this file since 109091 was 108794, checked in by vboxsync, 5 weeks ago

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

  • Property svn:eol-style set to native
File size: 966 bytes
Line 
1/** @file
2 Provides the required functionality for handling stack
3 cookie check failures in GCC.
4
5 Copyright (c) Microsoft Corporation.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7**/
8
9#include <Base.h>
10
11#include <Library/DebugLib.h>
12#include <Library/BaseLib.h>
13#include <Library/StackCheckLib.h>
14#include <Library/StackCheckFailureHookLib.h>
15
16/**
17 Triggers an interrupt using the vector specified by PcdStackCookieExceptionVector
18**/
19VOID
20TriggerStackCookieInterrupt (
21 VOID
22 );
23
24VOID *__stack_chk_guard = (VOID *)(UINTN)STACK_COOKIE_VALUE;
25
26/**
27 This function gets called when a gcc/clang generated stack cookie fails. This implementation calls into a platform
28 failure hook lib and then triggers the stack cookie interrupt.
29
30**/
31VOID
32EFIAPI
33__stack_chk_fail (
34 VOID
35 )
36{
37 DEBUG ((DEBUG_ERROR, "Stack cookie check failed at address 0x%llx!\n", RETURN_ADDRESS (0)));
38 StackCheckFailureHook (RETURN_ADDRESS (0));
39 TriggerStackCookieInterrupt ();
40}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette