mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
Kernel: Don't CoW non-writable pages
A page fault in a page marked for CoW should not trigger a CoW if the page is non-writable. I think this makes sense.
This commit is contained in:
parent
f41ae755ec
commit
05c65fb4f1
1 changed files with 1 additions and 1 deletions
|
@ -284,7 +284,7 @@ PageFaultResponse Region::handle_fault(const PageFault& fault)
|
||||||
return handle_zero_fault(page_index_in_region);
|
return handle_zero_fault(page_index_in_region);
|
||||||
}
|
}
|
||||||
ASSERT(fault.type() == PageFault::Type::ProtectionViolation);
|
ASSERT(fault.type() == PageFault::Type::ProtectionViolation);
|
||||||
if (fault.access() == PageFault::Access::Write && should_cow(page_index_in_region)) {
|
if (fault.access() == PageFault::Access::Write && is_writable() && should_cow(page_index_in_region)) {
|
||||||
#ifdef PAGE_FAULT_DEBUG
|
#ifdef PAGE_FAULT_DEBUG
|
||||||
dbgprintf("PV(cow) fault in Region{%p}[%u]\n", this, page_index_in_region);
|
dbgprintf("PV(cow) fault in Region{%p}[%u]\n", this, page_index_in_region);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue