mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
Kernel: Disable KASLR on i686
The 32-bit CI runners don't seem to happy with KASLR, so let's make it x86-64 only for now.
This commit is contained in:
parent
9b9d32dfb2
commit
b6e767f953
Notes:
sideshowbarker
2024-07-17 16:57:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b6e767f953
1 changed files with 3 additions and 0 deletions
|
@ -95,10 +95,13 @@ extern "C" [[noreturn]] void init()
|
|||
#else
|
||||
FlatPtr kernel_load_base = 0x2000200000;
|
||||
#endif
|
||||
|
||||
#if ARCH(X86_64)
|
||||
// KASLR
|
||||
static constexpr auto maximum_offset = 256 * MiB;
|
||||
kernel_load_base = kernel_load_base + (generate_secure_seed() % maximum_offset);
|
||||
kernel_load_base = kernel_load_base & ~(PAGE_SIZE - 1);
|
||||
#endif
|
||||
|
||||
FlatPtr kernel_load_end = 0;
|
||||
for (size_t i = 0; i < kernel_elf_header.e_phnum; i++) {
|
||||
|
|
Loading…
Reference in a new issue