All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] [Mini-OS] Catch NULL dereferences
Date: Tue, 27 Nov 2007 11:23:05 +0000	[thread overview]
Message-ID: <20071127112305.GA5291@implementation.uk.xensource.com> (raw)

Unmap page 0 (only used early at boot) so as to catch NULL dereferences.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>

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;
 }

                 reply	other threads:[~2007-11-27 11:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071127112305.GA5291@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.