From a850a89c1b62bea35117ba8c10064949809c48bc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 17 Jan 2020 23:05:37 +0100 Subject: Kernel: Add a random offset to the base of the per-process VM allocator This is not ASLR, but it does de-trivialize exploiting the ELF loader which would previously always parse executables at 0x01001000 in every single exec(). I've taken advantage of this multiple times in my own toy exploits and it's starting to feel cheesy. :^) --- Kernel/VM/RangeAllocator.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Kernel/VM/RangeAllocator.h') diff --git a/Kernel/VM/RangeAllocator.h b/Kernel/VM/RangeAllocator.h index 90f043bba9..5b8e50a728 100644 --- a/Kernel/VM/RangeAllocator.h +++ b/Kernel/VM/RangeAllocator.h @@ -47,10 +47,12 @@ private: class RangeAllocator { public: - RangeAllocator(VirtualAddress, size_t); - RangeAllocator(const RangeAllocator&); + RangeAllocator(); ~RangeAllocator(); + void initialize_with_range(VirtualAddress, size_t); + void initialize_from_parent(const RangeAllocator&); + Range allocate_anywhere(size_t); Range allocate_specific(VirtualAddress, size_t); void deallocate(Range); -- cgit v1.2.3