1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:08:12 +00:00

Kernel: Fix memory purge clobbering mapped page directory in ensure_pte

If allocating a page table triggers purging memory, we need to call
quickmap_pd again to make sure the underlying physical page is
remapped to the correct one. This is needed because purging itself
may trigger calls to ensure_pte as well.

Fixes #3370
This commit is contained in:
Tom 2020-09-01 13:40:34 -06:00 committed by Andreas Kling
parent 30d36a3ad1
commit 83ddf3d850
2 changed files with 17 additions and 3 deletions

View file

@ -112,7 +112,7 @@ public:
Yes
};
RefPtr<PhysicalPage> allocate_user_physical_page(ShouldZeroFill = ShouldZeroFill::Yes);
RefPtr<PhysicalPage> allocate_user_physical_page(ShouldZeroFill = ShouldZeroFill::Yes, bool* did_purge = nullptr);
RefPtr<PhysicalPage> allocate_supervisor_physical_page();
NonnullRefPtrVector<PhysicalPage> allocate_contiguous_supervisor_physical_pages(size_t size);
void deallocate_user_physical_page(const PhysicalPage&);