x86_64: fail or attempt to map page-tables read/write
authorReto Achermann <reto.achermann@inf.ethz.ch>
Fri, 19 Jul 2019 14:55:18 +0000 (16:55 +0200)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Fri, 19 Jul 2019 14:55:18 +0000 (16:55 +0200)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

kernel/arch/x86_64/page_mappings_arch.c

index 5c3b556..3644667 100644 (file)
@@ -294,7 +294,6 @@ static errval_t x86_64_ptable(struct capability *dest, cslot_t slot,
     if (src->type != ObjType_Frame &&
         src->type != ObjType_DevFrame &&
         //(!type_is_ept(dest->type) &&
-        src->type != ObjType_RAM &&
         !type_is_vnode(src->type) &&
         src->type != ObjType_EndPointUMP) { // Right mapping
         debug(SUBSYS_PAGING, "src type invalid\n");
@@ -336,8 +335,7 @@ static errval_t x86_64_ptable(struct capability *dest, cslot_t slot,
         !dcb_current->is_vm_guest)
     {
         if (flags & X86_64_PTABLE_READ_WRITE) {
-            printk(LOG_NOTE, "masking WRITE permission on page table.\n");
-            flags &= ~X86_64_PTABLE_READ_WRITE;
+            return SYS_ERR_VM_MAP_RIGHTS;
         }
     }