From 782b0de02d3ff1499917fc1940523a66a418ba27 Mon Sep 17 00:00:00 2001 From: Amelia Coutard Date: Sun, 6 Aug 2023 03:53:57 +0200 Subject: [PATCH] Fixed missing value init in elf loader --- kernel/src/elf64.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/src/elf64.cpp b/kernel/src/elf64.cpp index 88fbf29..cf586ac 100644 --- a/kernel/src/elf64.cpp +++ b/kernel/src/elf64.cpp @@ -34,6 +34,7 @@ void os::elf::load_elf(os::process& result, std::byte* start, std::size_t length std::byte* const stack = (std::byte*)0x0000'8000'0000'0000 - stack_size; result.PML4T = phys_ptr(os::paging::page_allocator.allocate(1).ptr.get_phys_addr()); + memset(&*result.PML4T, 0, 0x1000); result.rip = std::uint64_t(elf_header.entry); result.rsp = std::uint64_t(stack + stack_size); result.rax = 0; -- 2.47.0