mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03: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
Notes:
sideshowbarker
2024-07-17 19:01:36 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/75fe51a9ca Pull-request: https://github.com/SerenityOS/serenity/pull/12422
@ -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();
|
||||
|
||||
|
@ -188,6 +188,8 @@ public:
|
||||
|
||||
void remap();
|
||||
|
||||
[[nodiscard]] bool is_mapped() const { return m_page_directory != nullptr; }
|
||||
|
||||
void clear_to_zero();
|
||||
|
||||
[[nodiscard]] bool is_syscall_region() const { return m_syscall_region; }
|
||||
|
Loading…
Reference in New Issue
Block a user