mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +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
Notes:
sideshowbarker
2024-07-17 10:02:46 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/cedec9751a Pull-request: https://github.com/SerenityOS/serenity/pull/14189 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/linusg
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();
|
||||
constexpr FlatPtr userspace_range_base = USER_RANGE_BASE;
|
||||
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;
|
||||
return VirtualRange(VirtualAddress { base }, userspace_range_ceiling - base);
|
||||
}();
|
||||
|
|
Loading…
Reference in a new issue