mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:55:08 +00:00
Kernel: Don't turn private read-only regions into shared ones on fork
Even if they are read-only now, they can be mprotect(PROT_WRITE)'d in the future, so we have to make sure they are CoW mapped.
This commit is contained in:
parent
3fbc50a350
commit
05a441afb2
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,8 @@ NonnullOwnPtr<Region> Region::clone()
|
|||
// NOTE: Kernel-only regions should never be cloned.
|
||||
ASSERT(is_user_accessible());
|
||||
|
||||
if (m_shared || (is_readable() && !is_writable())) {
|
||||
// FIXME: What should we do for privately mapped InodeVMObjects?
|
||||
if (m_shared || vmobject().is_inode()) {
|
||||
ASSERT(!m_stack);
|
||||
#ifdef MM_DEBUG
|
||||
dbgprintf("%s<%u> Region::clone(): sharing %s (V%p)\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue