diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-28 14:55:06 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-28 16:23:38 +0100 |
commit | b6937e2560308379460a9f6d4a61bbf55e17dfde (patch) | |
tree | 5ca13691c5142131028d0753c8a982e6dcbc1ea4 /Kernel/VM/RangeAllocator.h | |
parent | d3de138d64e49bf04fcd1aaa5a98dff8bf230f91 (diff) | |
download | serenity-b6937e2560308379460a9f6d4a61bbf55e17dfde.zip |
Kernel+LibC: Add MAP_RANDOMIZED flag for sys$mmap()
This can be used to request random VM placement instead of the highly
predictable regular mmap(nullptr, ...) VM allocation strategy.
It will soon be used to implement ASLR in the dynamic loader. :^)
Diffstat (limited to 'Kernel/VM/RangeAllocator.h')
-rw-r--r-- | Kernel/VM/RangeAllocator.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/VM/RangeAllocator.h b/Kernel/VM/RangeAllocator.h index 0839e0bb57..97e58d02ec 100644 --- a/Kernel/VM/RangeAllocator.h +++ b/Kernel/VM/RangeAllocator.h @@ -87,6 +87,7 @@ public: Optional<Range> allocate_anywhere(size_t, size_t alignment = PAGE_SIZE); Optional<Range> allocate_specific(VirtualAddress, size_t); + Optional<Range> allocate_randomized(size_t, size_t alignment); void deallocate(const Range&); void dump() const; |