diff options
author | Andreas Kling <kling@serenityos.org> | 2022-03-22 02:47:27 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-22 02:47:27 +0100 |
commit | b6e767f9530256fee6b430a32be255f2df3e9bc5 (patch) | |
tree | 0116c4bc398e812d0fe60f7d6bd8e031e9961f0f /Kernel | |
parent | 9b9d32dfb2a0ef5b8972a09489bc451fafbda390 (diff) | |
download | serenity-b6e767f9530256fee6b430a32be255f2df3e9bc5.zip |
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.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Prekernel/init.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Prekernel/init.cpp b/Kernel/Prekernel/init.cpp index 01ae0629d4..ef55299346 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++) { |