diff options
author | Andreas Kling <kling@serenityos.org> | 2020-01-29 19:24:42 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-30 21:51:27 +0100 |
commit | afd2b5a53e68a21dcb48c00a0630b00b63c17ced (patch) | |
tree | 82e9fb2f23a07575da8186655f8663ca5dd44c5a | |
parent | c9e877a29486eb6bc0bc616d2da76276196e4b8f (diff) | |
download | serenity-afd2b5a53e68a21dcb48c00a0630b00b63c17ced.zip |
Kernel: Copy "stack" and "mmap" bits when splitting a Region
-rw-r--r-- | Kernel/Process.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 195cc64aff..d1bf102a0e 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -168,6 +168,8 @@ static unsigned prot_to_region_access_flags(int prot) Region& Process::allocate_split_region(const Region& source_region, const Range& range, size_t offset_in_vmobject) { auto& region = add_region(Region::create_user_accessible(range, source_region.vmobject(), offset_in_vmobject, source_region.name(), source_region.access())); + region.set_mmap(source_region.is_mmap()); + region.set_stack(source_region.is_stack()); size_t page_offset_in_source_region = (offset_in_vmobject - source_region.offset_in_vmobject()) / PAGE_SIZE; for (size_t i = 0; i < region.page_count(); ++i) { if (source_region.should_cow(page_offset_in_source_region + i)) |