diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 23:05:37 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 23:29:54 +0100 |
commit | a850a89c1b62bea35117ba8c10064949809c48bc (patch) | |
tree | 61f3cfead64840bc66d70903b4ccdad2ef8ad96e /Kernel/VM/RangeAllocator.h | |
parent | 536c0ff3ee048f1ae5b2967cce8d475c4e7da1d9 (diff) | |
download | serenity-a850a89c1b62bea35117ba8c10064949809c48bc.zip |
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. :^)
Diffstat (limited to 'Kernel/VM/RangeAllocator.h')
-rw-r--r-- | Kernel/VM/RangeAllocator.h | 6 |
1 files changed, 4 insertions, 2 deletions
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); |