diff --git a/Kernel/Prekernel/init.cpp b/Kernel/Prekernel/init.cpp index 01ae0629d46..ef552993461 100644 --- a/Kernel/Prekernel/init.cpp +++ b/Kernel/Prekernel/init.cpp @@ -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++) {