mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Kernel: Don't request a random u32 when all but 5 bits are immediately masked off
This commit is contained in:
parent
924951e426
commit
6e1d6d1ff5
Notes:
sideshowbarker
2024-07-19 03:40:45 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/6e1d6d1ff58 Pull-request: https://github.com/SerenityOS/serenity/pull/3121
@ -80,7 +80,7 @@ PageDirectory::PageDirectory(Process& process, const RangeAllocator* parent_rang
|
||||
if (parent_range_allocator) {
|
||||
m_range_allocator.initialize_from_parent(*parent_range_allocator);
|
||||
} else {
|
||||
size_t random_offset = (get_fast_random<u32>() % 32 * MB) & PAGE_MASK;
|
||||
size_t random_offset = (get_fast_random<u8>() % 32 * MB) & PAGE_MASK;
|
||||
u32 base = userspace_range_base + random_offset;
|
||||
m_range_allocator.initialize_with_range(VirtualAddress(base), userspace_range_ceiling - base);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user