1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:57:35 +00:00

Kernel: Fix kmalloc memory corruption

Rather than hardcoding where the kmalloc pool should be, place
it at the end of the kernel image instead. This avoids corrupting
global variables or other parts of the kernel as it grows.

Fixes #3257
This commit is contained in:
Tom 2020-08-24 16:38:20 -06:00 committed by Andreas Kling
parent 08a569fbe0
commit ba6e4fb77f
3 changed files with 40 additions and 10 deletions

View file

@ -61,3 +61,6 @@ inline void* operator new[](size_t, void* p) { return p; }
#endif
return kmalloc_impl(size);
}
extern u8* const kmalloc_start;
extern u8* const kmalloc_end;