summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-03 03:44:55 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-03 03:44:55 +0100
commit8cc5fa55988b84a57bc2afabda8a5f79dbbdf06f (patch)
treef4b66c7e231d8b67f1a55c411701e245d66c75c6
parent93e9a42bf04a1ec841353e7b1959107c731d60ad (diff)
downloadserenity-8cc5fa55988b84a57bc2afabda8a5f79dbbdf06f.zip
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.
-rw-r--r--Kernel/Process.cpp2
1 files changed, 1 insertions, 1 deletions
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<Module>();
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;