From d35b4de246d49bf15f44b6e5db71c3b918c5e7fa Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 16 Oct 2022 21:25:11 +0300 Subject: [PATCH] added no_stack_protector attribute to functions --- Architecture/amd64/cpu/GlobalDescriptorTable.cpp | 2 +- Core/CrashHandler.cpp | 6 +++--- Core/Interrupts/IntManager.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Architecture/amd64/cpu/GlobalDescriptorTable.cpp b/Architecture/amd64/cpu/GlobalDescriptorTable.cpp index 774f256..b938012 100644 --- a/Architecture/amd64/cpu/GlobalDescriptorTable.cpp +++ b/Architecture/amd64/cpu/GlobalDescriptorTable.cpp @@ -26,7 +26,7 @@ namespace GlobalDescriptorTable 0, }; - void Init(int Core) + __attribute__((no_stack_protector)) void Init(int Core) { CPU::x64::lgdt(&gdt); diff --git a/Core/CrashHandler.cpp b/Core/CrashHandler.cpp index 946f7bd..61ac233 100644 --- a/Core/CrashHandler.cpp +++ b/Core/CrashHandler.cpp @@ -53,13 +53,13 @@ void UserModeExceptionHandler(CPU::x64::TrapFrame *Frame); namespace CrashHandler { - void printfWrapper(char c, void *unused) + __attribute__((no_stack_protector)) void printfWrapper(char c, void *unused) { Display->Print(c, 255, true); UNUSED(unused); } - void EHPrint(const char *Format, ...) + __attribute__((no_stack_protector)) void EHPrint(const char *Format, ...) { va_list args; va_start(args, Format); @@ -67,7 +67,7 @@ namespace CrashHandler va_end(args); } - void Handle(void *Data) + __attribute__((no_stack_protector)) void Handle(void *Data) { CPU::Interrupts(CPU::Disable); diff --git a/Core/Interrupts/IntManager.cpp b/Core/Interrupts/IntManager.cpp index 50eb7af..7f76660 100644 --- a/Core/Interrupts/IntManager.cpp +++ b/Core/Interrupts/IntManager.cpp @@ -16,7 +16,7 @@ #include "../crashhandler.hpp" #include "../kernel.h" -extern "C" void ExceptionHandler(void *Data) { CrashHandler::Handle(Data); } +extern "C" __attribute__((no_stack_protector)) void ExceptionHandler(void *Data) { CrashHandler::Handle(Data); } namespace Interrupts {