mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:27:42 +00:00
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:
parent
7a8efa7771
commit
821a6e8b4c
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue