mirror of
https://github.com/limine-bootloader/limine
synced 2025-01-04 03:54:24 +03:00
protos/limine: Limit KASLR wiggle room to a quarter instead of half of the higher half
This commit is contained in:
parent
cf30cb1b39
commit
11d345ebb0
@ -235,8 +235,8 @@ static void **requests;
|
||||
static void set_paging_mode(int paging_mode, bool kaslr) {
|
||||
direct_map_offset = paging_mode_higher_half(paging_mode);
|
||||
if (kaslr) {
|
||||
// Half of the higher half of wiggle room for KASLR, align to 1GiB steps.
|
||||
uint64_t mask = ((uint64_t)1 << (paging_mode_va_bits(paging_mode) - 2)) - 1;
|
||||
// A quarter of the higher half of wiggle room for KASLR, align to 1GiB steps.
|
||||
uint64_t mask = ((uint64_t)1 << (paging_mode_va_bits(paging_mode) - 3)) - 1;
|
||||
direct_map_offset += (rand64() & ~((uint64_t)0x40000000 - 1)) & mask;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user