diff options
author | Tom <tomut@yahoo.com> | 2020-08-24 16:38:20 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-25 09:48:48 +0200 |
commit | ba6e4fb77f00587d2bd57865a00b1a4526684741 (patch) | |
tree | 2d92fa94a996fdfcc70e4c9a59f41fa90c469519 /Kernel/Heap/kmalloc.h | |
parent | 08a569fbe0567eb4d8aebb08d3021c4103684635 (diff) | |
download | serenity-ba6e4fb77f00587d2bd57865a00b1a4526684741.zip |
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
Diffstat (limited to 'Kernel/Heap/kmalloc.h')
-rw-r--r-- | Kernel/Heap/kmalloc.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Heap/kmalloc.h b/Kernel/Heap/kmalloc.h index cf28535227..75f0fab642 100644 --- a/Kernel/Heap/kmalloc.h +++ b/Kernel/Heap/kmalloc.h @@ -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; |