From 19d16620a64f12f5d7f797d951d8ed959d7798d1 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 5 Sep 2024 14:50:05 +0300 Subject: [PATCH] DynamicLoader: Don't do file backed mapping for filesz == 0 --- userspace/programs/DynamicLoader/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/programs/DynamicLoader/main.cpp b/userspace/programs/DynamicLoader/main.cpp index 9e90f366..659b377d 100644 --- a/userspace/programs/DynamicLoader/main.cpp +++ b/userspace/programs/DynamicLoader/main.cpp @@ -622,7 +622,7 @@ static void load_program_header(const ElfNativeProgramHeader& program_header, in return result; }(); - if ((program_header.p_vaddr & 0xFFF) || (program_header.p_offset & 0xFFF)) + if ((program_header.p_vaddr & 0xFFF) || (program_header.p_offset & 0xFFF) || program_header.p_filesz == 0) { const uintptr_t aligned_addr = program_header.p_vaddr & ~(uintptr_t)0xFFF;