mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +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
Notes:
sideshowbarker
2024-07-19 10:58:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/05c65fb4f1c
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);
|
||||
}
|
||||
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
|
||||
dbgprintf("PV(cow) fault in Region{%p}[%u]\n", this, page_index_in_region);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue