diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-27 16:56:50 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-27 16:56:50 +0100 |
commit | 19fc62f445deafa2dfaec1cfde534cc920e349ab (patch) | |
tree | 38fb27cf210f7993e79d574830357699dbd2bd73 /Kernel/VM | |
parent | d8fa479d05e0a13789e508e4245427982db5abc5 (diff) | |
download | serenity-19fc62f445deafa2dfaec1cfde534cc920e349ab.zip |
Kernel: Use get_fast_random() for MAP_RANDOMIZED addresses
Let's not block sys$mmap() on kernel randomness.
Diffstat (limited to 'Kernel/VM')
-rw-r--r-- | Kernel/VM/RangeAllocator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/VM/RangeAllocator.cpp b/Kernel/VM/RangeAllocator.cpp index 6ac0e045f9..26561bfe6b 100644 --- a/Kernel/VM/RangeAllocator.cpp +++ b/Kernel/VM/RangeAllocator.cpp @@ -90,7 +90,7 @@ Optional<Range> RangeAllocator::allocate_randomized(size_t size, size_t alignmen // FIXME: I'm sure there's a smarter way to do this. static constexpr size_t maximum_randomization_attempts = 1000; for (size_t i = 0; i < maximum_randomization_attempts; ++i) { - VirtualAddress random_address { round_up_to_power_of_two(get_good_random<FlatPtr>(), alignment) }; + VirtualAddress random_address { round_up_to_power_of_two(get_fast_random<FlatPtr>(), alignment) }; if (!m_total_range.contains(random_address, size)) continue; |