[Mini-OS] Catch NULL dereferences
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Nov 2007 12:42:17 +0000 (12:42 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Nov 2007 12:42:17 +0000 (12:42 +0000)
Unmap page 0 (only used early at boot) so as to catch NULL dereferences.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
extras/mini-os/arch/x86/mm.c

index 8d4a8d42fba7fad95682b95b7e98130fd7593b67..70143b3e1a2168ae00ff8c1e0a445ae774f98cfb 100644 (file)
@@ -270,6 +270,9 @@ void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
         start_address += PAGE_SIZE;
     }
 
+    if (HYPERVISOR_update_va_mapping(0, (pte_t) {}, UVMF_INVLPG))
+        printk("Unable to unmap page 0\n");
+
     *start_pfn = pt_pfn;
 }