1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00

Kernel: Stop trying to write unmapped Process regions into CoreDumps

If we crashed in the middle of mapping in Regions, some of the regions
may not have a page directory yet, and will result in a crash when
Region::remap() is called.
This commit is contained in:
Idan Horowitz 2022-02-10 19:59:26 +02:00
parent 57bce8ab97
commit 75fe51a9ca
2 changed files with 6 additions and 0 deletions

View file

@ -186,6 +186,10 @@ ErrorOr<void> Coredump::write_regions()
if (region->access() == Memory::Region::Access::None)
continue;
// If we crashed in the middle of mapping in Regions, they do not have a page directory yet, and will crash on a remap() call
if (!region->is_mapped())
continue;
region->set_readable(true);
region->remap();