diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-21 16:03:03 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-21 16:03:56 +0100 |
commit | 04e40da1885f86a23c66dca0f034fe9cbb70665f (patch) | |
tree | f423aff7d7346f390a201efba6b033f8b7a07bde /Kernel/VM | |
parent | 59b9e49bcdad278e50400b3cdb41bc83e744d604 (diff) | |
download | serenity-04e40da1885f86a23c66dca0f034fe9cbb70665f.zip |
Kernel: Fix crash when reading /proc/PID/vmobjects
InodeVMObjects can have nulled-out physical page slots. That just means
we haven't cached that page from disk right now.
Diffstat (limited to 'Kernel/VM')
-rw-r--r-- | Kernel/VM/Region.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp index 1db032ec74..2c02c045d3 100644 --- a/Kernel/VM/Region.cpp +++ b/Kernel/VM/Region.cpp @@ -235,7 +235,8 @@ NonnullOwnPtr<Region> Region::create_kernel_only(const Range& range, const Strin bool Region::should_cow(size_t page_index) const { - if (vmobject().physical_pages()[page_index]->is_shared_zero_page()) + auto& slot = vmobject().physical_pages()[page_index]; + if (slot && slot->is_shared_zero_page()) return true; if (m_shared) return false; |