From 52cbbe1dc534feb7a8f5813ef07ade242873d794 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 22:25:37 +0200 Subject: [PATCH] Kernel: Actually share committed CoW pages Due to a double-move mistake, we were always clearing the shared committed CoW pages in the parent when forking. --- Kernel/Memory/AnonymousVMObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Memory/AnonymousVMObject.cpp b/Kernel/Memory/AnonymousVMObject.cpp index f332823b89..e57612987c 100644 --- a/Kernel/Memory/AnonymousVMObject.cpp +++ b/Kernel/Memory/AnonymousVMObject.cpp @@ -46,7 +46,7 @@ KResultOr> AnonymousVMObject::try_clone() if (!new_shared_committed_cow_pages) return ENOMEM; - auto maybe_clone = adopt_ref_if_nonnull(new (nothrow) AnonymousVMObject(*this, new_shared_committed_cow_pages.release_nonnull())); + auto maybe_clone = adopt_ref_if_nonnull(new (nothrow) AnonymousVMObject(*this, *new_shared_committed_cow_pages)); if (!maybe_clone) return ENOMEM; auto clone = maybe_clone.release_nonnull();