mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +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
Notes:
sideshowbarker
2024-07-18 07:33:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/821a6e8b4ce
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…
Reference in a new issue