From 8cc5fa55988b84a57bc2afabda8a5f79dbbdf06f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 3 Jan 2020 03:44:55 +0100 Subject: [PATCH] Kernel: Unbreak module loading (broke with NX bit changes) Modules are now mapped fully RWX. This can definitely be improved, but at least it unbreaks the feature for now. --- Kernel/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e36d023900..77686ada58 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -3780,7 +3780,7 @@ int Process::sys$module_load(const char* path, size_t path_length) auto module = make(); elf_image->for_each_section_of_type(SHT_PROGBITS, [&](const ELFImage::Section& section) { - auto section_storage = KBuffer::copy(section.raw_data(), section.size()); + auto section_storage = KBuffer::copy(section.raw_data(), section.size(), Region::Access::Read | Region::Access::Write | Region::Access::Execute); section_storage_by_name.set(section.name(), section_storage.data()); module->sections.append(move(section_storage)); return IterationDecision::Continue;