Kernel: Remap regions after changing purgeable VM object volatile flag

Otherwise we could end up with stale page table mappings that give us
erroneous Protection Violation faults when accessing valid addresses.
This commit is contained in:
Andreas Kling 2021-08-03 10:21:49 +02:00
parent 7a8efa7771
commit 821a6e8b4c
Notes: sideshowbarker 2024-07-18 07:33:03 +09:00

View file

@ -230,6 +230,8 @@ KResult AnonymousVMObject::set_volatile(bool is_volatile, bool& was_purged)
m_volatile = true;
m_was_purged = false;
for_each_region([&](auto& region) { region.remap(); });
return KSuccess;
}
// When a VMObject is made non-volatile, we try to commit however many pages are not currently available.
@ -258,6 +260,7 @@ KResult AnonymousVMObject::set_volatile(bool is_volatile, bool& was_purged)
m_volatile = false;
m_was_purged = false;
for_each_region([&](auto& region) { region.remap(); });
return KSuccess;
}