mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 13:07:42 +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:
parent
57bce8ab97
commit
75fe51a9ca
2 changed files with 6 additions and 0 deletions
|
@ -186,6 +186,10 @@ ErrorOr<void> Coredump::write_regions()
|
||||||
if (region->access() == Memory::Region::Access::None)
|
if (region->access() == Memory::Region::Access::None)
|
||||||
continue;
|
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->set_readable(true);
|
||||||
region->remap();
|
region->remap();
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,8 @@ public:
|
||||||
|
|
||||||
void remap();
|
void remap();
|
||||||
|
|
||||||
|
[[nodiscard]] bool is_mapped() const { return m_page_directory != nullptr; }
|
||||||
|
|
||||||
void clear_to_zero();
|
void clear_to_zero();
|
||||||
|
|
||||||
[[nodiscard]] bool is_syscall_region() const { return m_syscall_region; }
|
[[nodiscard]] bool is_syscall_region() const { return m_syscall_region; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue