1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 16:25:08 +00:00

Kernel: Make kernel memory regions be non-executable by default

From now on, you'll have to request executable memory specifically
if you want some.
This commit is contained in:
Andreas Kling 2019-12-25 22:41:34 +01:00
parent 0b7a2e0a5a
commit 9e55bcb7da
7 changed files with 27 additions and 31 deletions

View file

@ -107,7 +107,7 @@ String ELFLoader::symbolicate(u32 address, u32* out_offset) const
SortedSymbol* sorted_symbols = nullptr;
#ifdef KERNEL
if (!m_sorted_symbols_region) {
m_sorted_symbols_region = MM.allocate_kernel_region(PAGE_ROUND_UP(m_image.symbol_count() * sizeof(SortedSymbol)), "Sorted symbols");
m_sorted_symbols_region = MM.allocate_kernel_region(PAGE_ROUND_UP(m_image.symbol_count() * sizeof(SortedSymbol)), "Sorted symbols", Region::Access::Read | Region::Access::Write);
sorted_symbols = (SortedSymbol*)m_sorted_symbols_region->vaddr().as_ptr();
size_t index = 0;
m_image.for_each_symbol([&](auto& symbol) {