From e1476788adfd79e9e3f54afba33645c370a82ec5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 18 Aug 2022 20:59:04 +0200 Subject: [PATCH] Kernel: Make sys$anon_create() allocate physical pages immediately This fixes an issue where a sharing process would map the "lazy committed page" early and then get stuck with that page even after it had been replaced in the VMObject by a page fault. Regressed in 27c1135d307efde8d9baef2affb26be568d50263, which made it happen every time with the backing bitmaps used for WebContent. --- Kernel/Syscalls/anon_create.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Syscalls/anon_create.cpp b/Kernel/Syscalls/anon_create.cpp index 2c57148f1e..334e7e9797 100644 --- a/Kernel/Syscalls/anon_create.cpp +++ b/Kernel/Syscalls/anon_create.cpp @@ -26,7 +26,7 @@ ErrorOr Process::sys$anon_create(size_t size, int options) return EINVAL; auto new_fd = TRY(allocate_fd()); - auto vmobject = TRY(Memory::AnonymousVMObject::try_create_purgeable_with_size(size, AllocationStrategy::Reserve)); + auto vmobject = TRY(Memory::AnonymousVMObject::try_create_purgeable_with_size(size, AllocationStrategy::AllocateNow)); auto anon_file = TRY(AnonymousFile::try_create(move(vmobject))); auto description = TRY(OpenFileDescription::try_create(move(anon_file)));