1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

Kernel: Non-readable-but-writable regions should still be mapped

Fixes #1436.
This commit is contained in:
Andreas Kling 2020-04-03 09:59:58 +02:00
parent df7062aac5
commit 522d8c5d71

View file

@ -215,7 +215,7 @@ void Region::map_individual_page_impl(size_t page_index)
auto page_vaddr = vaddr().offset(page_index * PAGE_SIZE);
auto& pte = MM.ensure_pte(*m_page_directory, page_vaddr);
auto& physical_page = vmobject().physical_pages()[first_page_index() + page_index];
if (!physical_page || !is_readable()) {
if (!physical_page || (!is_readable() && !is_writable())) {
pte.clear();
} else {
pte.set_cache_disabled(!m_cacheable);