1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:37:35 +00:00

Kernel/riscv64: Don't disable stack protector and sanitizers

I am not sure why 096cecb95e disabled the stack protector and sanitizers
for all files, but this is not necessary.
Only the pre_init code needs to run without them, as that code runs
identity mapped.
This commit is contained in:
Sönke Holz 2024-01-19 15:30:23 +01:00 committed by Andrew Kaster
parent 900ec37f81
commit 0e6d87fe83
2 changed files with 25 additions and 2 deletions

View file

@ -45,7 +45,11 @@ public:
u64* page = m_current;
m_current += (PAGE_TABLE_SIZE / sizeof(FlatPtr));
__builtin_memset(page, 0, PAGE_TABLE_SIZE);
// We can't use [__builtin_]memset here, as that would call into code which has stack protectors enabled,
// resulting in an access to an absolute address.
for (u64* p = page; p < page + (PAGE_TABLE_SIZE / sizeof(u64)); p++)
*p = 0;
return page;
}