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

Kernel: Fix partial munmap() deallocating still-in-use VM

We were always returning the full VM range of the partially-unmapped
Region to the range allocator. This caused us to re-use those addresses
for subsequent VM allocations.

This patch also skips creating a new VMObject in partial munmap().
Instead we just make split regions that point into the same VMObject.

This fixes the mysterious GCC ICE on large C++ programs.
This commit is contained in:
Andreas Kling 2019-09-27 20:17:41 +02:00
parent d5f3972012
commit 2584636d19
4 changed files with 17 additions and 12 deletions

View file

@ -48,7 +48,7 @@ public:
PageFaultResponse handle_page_fault(const PageFault&);
bool map_region(Process&, Region&);
bool unmap_region(Region&);
bool unmap_region(Region&, bool deallocate_range = true);
void populate_page_directory(PageDirectory&);