mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 21:10:30 +00:00
Kernel: Copy Region's "is_mmap" flag when cloning regions for fork()
Otherwise child processes will not be allowed to munmap(), madvise(), etc. on the cloned regions!
This commit is contained in:
parent
8c5cd97b45
commit
5c3c2a9bac
Notes:
sideshowbarker
2024-07-19 10:13:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5c3c2a9bacf
1 changed files with 4 additions and 1 deletions
|
@ -65,7 +65,9 @@ NonnullOwnPtr<Region> Region::clone()
|
|||
vaddr().get());
|
||||
#endif
|
||||
// Create a new region backed by the same VMObject.
|
||||
return Region::create_user_accessible(m_range, m_vmobject, m_offset_in_vmobject, m_name, m_access);
|
||||
auto region = Region::create_user_accessible(m_range, m_vmobject, m_offset_in_vmobject, m_name, m_access);
|
||||
region->set_mmap(m_mmap);
|
||||
return region;
|
||||
}
|
||||
|
||||
#ifdef MM_DEBUG
|
||||
|
@ -87,6 +89,7 @@ NonnullOwnPtr<Region> Region::clone()
|
|||
ASSERT(vmobject().is_anonymous());
|
||||
clone_region->set_stack(true);
|
||||
}
|
||||
clone_region->set_mmap(m_mmap);
|
||||
return clone_region;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue