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

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.
This commit is contained in:
Andreas Kling 2020-02-21 16:03:03 +01:00
parent 59b9e49bcd
commit 04e40da188

View file

@ -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;