kernel/vm: restrict permission changes on shared file-mapped areas

a protection_max attribute is added in VMArea.
a read-only opened file already can't be mapped shared read-write at the moment,
but can later be changed to read-write with mprotect() or set_area_protection().
When creating the VMArea, the actual maximum protection is stored in the area,
so that it can be checked when needed.
this fixes a VM TODO.

Change-Id: I33b144c192034eeb059f1dede5dbef5af947280d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3804
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Jérôme Duval
2021-03-23 17:40:31 +00:00
committed by Adrien Destugues
parent 99806fe3d6
commit 45872f7f9c
3 changed files with 44 additions and 20 deletions
+1
View File
@@ -100,6 +100,7 @@ public:
area_id id;
char name[B_OS_NAME_LENGTH];
uint32 protection;
uint32 protection_max;
uint16 wiring;
private: