1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Kernel+LibC: Build with basic -fstack-protector support

Use simple stack cookies to try to provoke an assertion failure on
stack overflow.

This is far from perfect, since we use a constant cookie instead of
generating a random one on startup, but it can still help us catch
bugs, which is the primary concern right now. :^)
This commit is contained in:
Andreas Kling 2019-12-20 20:51:50 +01:00
parent f006e66a25
commit 842716a0b5
3 changed files with 18 additions and 1 deletions

View file

@ -183,4 +183,12 @@ void free(void* p)
{
return kfree(p);
}
extern u32 __stack_chk_guard;
u32 __stack_chk_guard = (u32)0xc0000c13;
[[noreturn]] void __stack_chk_fail()
{
ASSERT_NOT_REACHED();
}
}