aboutsummaryrefslogtreecommitdiff
path: root/kernel/kernel/stack_smashing_protector.c
blob: 3cff7dcd8b649c95ac79db9682c73dc53c42acb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdint.h>

#include <libk/io.h>

#include <kernel/halt.h>

/* TODO: Randomize */
#define STACK_CHK_GUARD 0xe2dee396

uintptr_t __stack_chk_guard = STACK_CHK_GUARD;

void
__stack_chk_fail(void)
{
  /* TODO: Panic the kernel */
  printk("SSP: Stack smashing detected!\n");
  halt();
}