Update page table in __stack_chk_fail and __chk_fail functions

This commit is contained in:
EnderIce2 2024-03-14 04:44:19 +02:00
parent 56e47f5cef
commit c197383a74
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -57,6 +57,8 @@ EXTERNC __constructor __no_stack_protector void __guard_setup(void)
EXTERNC __noreturn __no_stack_protector void __stack_chk_fail(void)
{
CPU::PageTable(KernelPageTable);
void *Stack = nullptr;
#if defined(a64)
asmv("movq %%rsp, %0"
@ -76,5 +78,7 @@ EXTERNC __noreturn __no_stack_protector void __stack_chk_fail(void)
// https://github.com/gcc-mirror/gcc/blob/master/libssp/ssp.c
EXTERNC __noreturn nsa void __chk_fail(void)
{
CPU::PageTable(KernelPageTable);
HandleBufferOverflow();
}