This commit is contained in:
Bananymous
2022-11-15 21:42:14 +02:00
parent 35e21ca4ce
commit 123382eace
13 changed files with 299 additions and 66 deletions

22
kernel/kernel/SSP.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#if UINT32_MAX == UINTPTR_MAX
#define STACK_CHK_GUARD 0xe2dee396
#else
#define STACK_CHK_GUARD 0x595e9fbd94fda766
#endif
uintptr_t __stack_chk_guard = STACK_CHK_GUARD;
__BEGIN_DECLS
__attribute__((noreturn))
void __stack_chk_fail(void)
{
printf("Stack smashing detected\n");
abort();
}
__END_DECLS