diff --git a/Kernel/MemoryManager.cpp b/Kernel/MemoryManager.cpp index 7dd4cd6cb5..8ab31a64e3 100644 --- a/Kernel/MemoryManager.cpp +++ b/Kernel/MemoryManager.cpp @@ -428,6 +428,10 @@ RetainPtr Region::clone() InterruptDisabler disabler; KernelPagingScope pagingScope; + if (is_readable && !is_writable) { + // Create a new region backed by the same zone. + return adopt(*new Region(linearAddress, size, zone.copyRef(), String(name), is_readable, is_writable)); + } // FIXME: Implement COW regions. auto clone_zone = MM.createZone(zone->size()); auto clone_region = adopt(*new Region(linearAddress, size, move(clone_zone), String(name), is_readable, is_writable));