From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] [Mini-OS] Catch NULL dereferences Date: Tue, 27 Nov 2007 11:23:05 +0000 Message-ID: <20071127112305.GA5291@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Unmap page 0 (only used early at boot) so as to catch NULL dereferences. Signed-off-by: Samuel Thibault diff -r 26e766e0c628 extras/mini-os/arch/x86/mm.c --- a/extras/mini-os/arch/x86/mm.c Mon Nov 26 22:28:48 2007 +0000 +++ b/extras/mini-os/arch/x86/mm.c Tue Nov 27 11:20:32 2007 +0000 @@ -270,6 +270,9 @@ void build_pagetable(unsigned long *star 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; }