haiku/headers/private/kernel/vm
Michael Lotz 75a10a74e8 kernel/vm: Make vm_copy_area take page protections into account.
When copying an area with vm_copy_area only the new protection would be
applied and any possibly existing page protections on the source area
were ignored.

For areas with stricter area protection than page protection, this lead
to faults when accessing the copy. In the opposite case it lead to too
relaxed protection. The currently only user of vm_copy_area is
fork_team which goes through all areas of the parent and copies them to
the new team. Hence page protections were ignored on all forked teams.

Remove the protection argument and instead always carry over the source
area protection and duplicate the page protections when present.

Also make sure to take the page protections into account for deciding
whether or not the copy is writable and therefore needs to have copy on
write semantics.

Change-Id: I52f295f2aaa66e31b4900b754343b3be9a19ba30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3166
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-23 00:55:58 +00:00
..
vm_page.h Add vm_page_free_etc() 2014-10-29 02:36:08 +01:00
vm_priv.h
vm_types.h
vm.h kernel/vm: Make vm_copy_area take page protections into account. 2020-08-23 00:55:58 +00:00
VMAddressSpace.h kernel/vm: Introduce and use VMAddressSpace::AreaRangeIterator. 2020-05-30 02:29:41 +00:00
VMArea.h kernel/vm: Inline the VMArea::name string. 2019-07-13 13:42:49 -04:00
VMCache.h kernel/vm: Add discard_address_range that discards pages. 2020-08-01 19:23:27 +00:00
VMTranslationMap.h kernel: Whitespace cleanup only. 2020-06-13 23:24:27 +02:00