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

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 27c1135d30, which made it
happen every time with the backing bitmaps used for WebContent.
This commit is contained in:
Andreas Kling 2022-08-18 20:59:04 +02:00
parent 81ee870c9b
commit e1476788ad

View file

@ -26,7 +26,7 @@ ErrorOr<FlatPtr> 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)));