mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue