summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-03 23:54:35 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-03 23:54:35 +0100
commit98b328754ec8bd29bd495c6567343e2422a33fa5 (patch)
treecf2daf1e4e4b2fb7934557145ab0e746497fb106
parent5b7f8634e3f62643fdfdb879f9fb3dc9163d40fe (diff)
downloadserenity-98b328754ec8bd29bd495c6567343e2422a33fa5.zip
Kernel: Fix bad setup of CoW faults for offset regions
Regions with an offset into their VMObject were incorrectly adding the page offset when indexing into the CoW bitmap.
-rw-r--r--Kernel/VM/MemoryManager.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index 1d7f87e8c3..f52e0c7ba5 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -697,8 +697,7 @@ void MemoryManager::map_region_at_address(PageDirectory& page_directory, Region&
if (physical_page) {
pte.set_physical_page_base(physical_page->paddr().get());
pte.set_present(true); // FIXME: Maybe we should use the is_readable flag here?
- // FIXME: It seems wrong that the *region* cow map is essentially using *VMO* relative indices.
- if (region.should_cow(region.first_page_index() + i))
+ if (region.should_cow(i))
pte.set_writable(false);
else
pte.set_writable(region.is_writable());