]> Zhao Yanbai Git Server - minix.git/commitdiff
vm: allow readonly pages when sanity checking when they're supposed to be rw.
authorBen Gras <ben@minix3.org>
Mon, 19 Jul 2010 18:19:16 +0000 (18:19 +0000)
committerBen Gras <ben@minix3.org>
Mon, 19 Jul 2010 18:19:16 +0000 (18:19 +0000)
servers/vm/arch/i386/pagetable.c

index ca7f37daa7a696151318f9886ed75d28f13cd5be..8b8a4c42647e17032c46140fabb5124e23d06a96 100644 (file)
@@ -581,6 +581,10 @@ PUBLIC int pt_writemap(pt_t *pt, vir_bytes v, phys_bytes physaddr,
                        maskedentry = pt->pt_pt[pde][pte];
                        maskedentry &= ~(I386_VM_ACC|I386_VM_DIRTY);
                        /* Verify pagetable entry. */
+                       if(entry & I386_VM_WRITE) {
+                               /* If we expect a writable page, allow a readonly page. */
+                               maskedentry |= I386_VM_WRITE;
+                       }
                        if(maskedentry != entry) {
                                printf("pt_writemap: mismatch: ");
                                if((entry & I386_VM_ADDR_MASK) !=