1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:48:11 +00:00

Kernel: Disable interrupts throughout ~Region()

We don't want an interrupt handler to access the VM data structures
while their internal consistency is broken.
This commit is contained in:
Andreas Kling 2019-09-05 11:13:10 +02:00
parent 5594f19624
commit bf43d94a2f

View file

@ -39,6 +39,10 @@ Region::Region(const Range& range, NonnullRefPtr<VMObject> vmo, size_t offset_in
Region::~Region()
{
// Make sure we disable interrupts so we don't get interrupted between unmapping and unregistering.
// Unmapping the region will give the VM back to the RangeAllocator, so an interrupt handler would
// find the address<->region mappings in an invalid state there.
InterruptDisabler disabler;
if (m_page_directory) {
MM.unmap_region(*this);
ASSERT(!m_page_directory);