mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
Kernel: Decrease the amount of address space offset randomization
This is basically unchanged since the beginning of 2020, which is a year before we had proper ASLR. Now that we have a proper ASLR implementation, we can turn this down a bit, as it is no longer our only protection against predictable dynamic loader addresses, and it actually obstructs the default loading address of x86_64 quite frequently.
This commit is contained in:
parent
cead476816
commit
cedec9751a
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ ErrorOr<NonnullOwnPtr<AddressSpace>> AddressSpace::try_create(AddressSpace const
|
||||||
return parent->m_region_tree.total_range();
|
return parent->m_region_tree.total_range();
|
||||||
constexpr FlatPtr userspace_range_base = USER_RANGE_BASE;
|
constexpr FlatPtr userspace_range_base = USER_RANGE_BASE;
|
||||||
FlatPtr const userspace_range_ceiling = USER_RANGE_CEILING;
|
FlatPtr const userspace_range_ceiling = USER_RANGE_CEILING;
|
||||||
size_t random_offset = (get_fast_random<u8>() % 32 * MiB) & PAGE_MASK;
|
size_t random_offset = (get_fast_random<u8>() % 2 * MiB) & PAGE_MASK;
|
||||||
FlatPtr base = userspace_range_base + random_offset;
|
FlatPtr base = userspace_range_base + random_offset;
|
||||||
return VirtualRange(VirtualAddress { base }, userspace_range_ceiling - base);
|
return VirtualRange(VirtualAddress { base }, userspace_range_ceiling - base);
|
||||||
}();
|
}();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue