:: commit 2f486fae6560188aa483d25ad02b61819763e133

mintsuki <mintsuki@protonmail.com> — 2020-12-04 23:44

parents: b75b35c557

elf32: Fix bug where vaddr was used for memory zeroing instead of paddr

diff --git a/limine-pxe.bin b/limine-pxe.bin
index fcf73d2f..c28edc50 100644
Binary files a/limine-pxe.bin and b/limine-pxe.bin differ
diff --git a/limine.bin b/limine.bin
index a3212a3b..c2ab236f 100644
Binary files a/limine.bin and b/limine.bin differ
diff --git a/stage2/lib/elf.c b/stage2/lib/elf.c
index afefe97b..60d30744 100644
--- a/stage2/lib/elf.c
+++ b/stage2/lib/elf.c
@@ -375,7 +375,7 @@ int elf32_load(struct file_handle *fd, uint32_t *entry_point, uint32_t *top, uin
         size_t to_zero = (size_t)(phdr.p_memsz - phdr.p_filesz);
 
         if (to_zero) {
-            void *ptr = (void *)(phdr.p_vaddr + phdr.p_filesz);
+            void *ptr = (void *)(phdr.p_paddr + phdr.p_filesz);
             memset(ptr, 0, to_zero);
         }
     }
tab: 248 wrap: offon