From 3e25ab6ae4574dbae25b080fe66dd7b1d5b95acb Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 18 Mar 2022 21:21:00 -0400 Subject: [PATCH] HELLO: Zero out page tables after allocating, before using --- src/hello/hello.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hello/hello.d b/src/hello/hello.d index e8d68f3..cd389ac 100644 --- a/src/hello/hello.d +++ b/src/hello/hello.d @@ -4,6 +4,7 @@ import scratch; import hulk.bootinfo; import hos.page_table; import hos.cpu; +import hos.memory; __gshared EFI_SYSTEM_TABLE * st; __gshared BootInfo bootinfo; @@ -124,7 +125,9 @@ private bool get_memory_map() private PageTableEntry * new_page_table() { - return cast(PageTableEntry *)scratch_alloc(1u); + PageTableEntry * pt = cast(PageTableEntry *)scratch_alloc(1u); + memset64(pt, 0u, 512); + return pt; } private void map(ulong source_page, ulong dest_page, PageTableEntry * pt_base)